Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Term reference field support.
This module can not display the term reference field yet.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1893278-term-reference-field-support.patch | 4.19 KB | mglaman |
Comments
Comment #1
nchar CreditAttribution: nchar commentedThats a great suggestion! I am going to add support for term reference fields soon. Thanks for your feedback!
Comment #2
nchar CreditAttribution: nchar commentedComment #3
rudy.barrett CreditAttribution: rudy.barrett commentedHey I'm wondering if any progress has been made on this feature. I would very much like to see it in place as well.
Thanks again for this awesome module, with taxonomy terms being used with it I will be able to completely ditch UC.
Comment #4
joep.hendrix CreditAttribution: joep.hendrix commentedGreat module!
The term reference option would be great.
Cheers!
Comment #5
Maroli CreditAttribution: Maroli commentedWhen would you have this ready? I am urgently needing this.
What I am doing is that I need to adjust price (and SKU) based on the size. This module seems to be able to achieve the price part. If adding another field (SKU) is also possible, please inform me about that.
If you have built in the support for term reference, pls let me know.
Comment #6
mglamanHere is my patch to add term reference field support. Created function "commerce_pricing_attributes_get_allowed_values" which checks what module the field belongs to. If it is a term reference field it will cycle through the terms and create an array similar to one outputted by the list field. This way there was no need for major overhaul of code.
Also in rules added an is_object check so that the rules knew how to handle the attribute value.
I did basic testing, have a client that will be using some in-depth products using pricing attributes based on term references. If I run into anything in the next few days I'll update my patch.
Comment #7
wqmeng CreditAttribution: wqmeng commented@mglaman
Thanks a lot for the patch, I have tried it and found that it not work very well with the module "Inline Entity Form", I always get this error and can not submit any change when edit the product with the Inline Entity Form.
Comment #8
mglaman@wqmeng
Thanks for checking it out. I didn't have issues with the inline entity form - just using demo Commerce Kickstart store for testing, and client's project site. When I view products and "Quick Edit" I'm able to edit the price and status without any errors. Ditto when editing the product variation from within a container (how I was testing when debugging patch.)
Can you point me in right direction to re-create this?
Comment #9
dgastudio CreditAttribution: dgastudio commentedi have both type of fields in optionset, default selects and taxonomy. It works fine, except one error
Error message
Notice: Undefined index: commerce_pricing_attributes in commerce_pricing_attributes_field_widget_form() (line 422 of /home/u7394/domains/shuba.u7394.shiva.vps-private.net/sites/all/modules/commerce_pricing_attributes/commerce_pricing_attributes.module).
any advice?
Comment #10
dgastudio CreditAttribution: dgastudio commentedsolved.
if (isset($option_field_instance['settings']['commerce_pricing_attributes'])){
$defaults = $option_field_instance['settings']['commerce_pricing_attributes'];
}
Comment #11
wqmeng CreditAttribution: wqmeng commentedHello mglaman,
That I have the same problem with this one?
#2043727: Multiple Pricing Attribute fields on one product throws error (workaround)
Do you have tested your products with Multiple Pricing Attributes which are both Term reference? I have create a new product with Multiple Pricing Attributes, still get the same errors.
Thanks
Comment #12
mglamanHey @wqmeng
I actually haven't used a product that has two product pricing attributes fields - just one with a LOT of options -- example: https://beta.justcamo.com/browse/auto/custom-seat-covers (launching site on the 11th, so if that is down/hidden, just remove beta)
I haven't had much time to debug my patch and flush it out, as I know there is a lot more work to be done to it, such as @kervi's comments.
Comment #13
amaria CreditAttribution: amaria commentedThanks for this patch! To make this work for a multi-select term field, I added the following code to your added if statement in the rule...
Will make a patch later...
Comment #14
soliyappan CreditAttribution: soliyappan commentedThanks mglaman ! #6 working fine .
Comment #15
mglamansoliyappan, marking as fixed means it has been committed. Please review the Issue queue handbook
The patch needs work to have kervi's comments added in, and should have amaria's notes added in as well. When patch gets re-rolled it can be marked "Needs Review" so people can test and RTBC so maintainers know to commit.
Comment #16
soliyappan CreditAttribution: soliyappan commentedAh ok mglaman, I am new to Drupal Community, Now i am facing this error in my site
Notice: Undefined variable: options in commerce_pricing_attributes_get_allowed_values() (line 1376 of /home2/v113/public_html/sites/all/modules/commerce_pricing_attributes/commerce_pricing_attributes.module).
Any help?
Comment #17
mglamanNo problem, soliyappan! The queues are a bit to get used to ;)
I'm not sure, I haven't worked on patch since I first posted it to get the client's site working, which was very specific in its use case. I tried to generalize the patch as much as I could but will need others to help contribute to patch via findings in order to improve.
Basically that's saying the $options variable is never defined.
Needs to initialize $options as empty array
Comment #18
iampumaWhy is this not yet ported after so long. Patch works perfectly.
Comment #19
crevko CreditAttribution: crevko commentedHello, patch from #6 works fine. Is here some possibility display list of terms on product page as images? Taxonomy terms in my project contains image field, and it would by more attractive for user display them instead of a name.
Comment #20
nexg CreditAttribution: nexg commentedThe patch works for term reference but default taxonomy term sort/weight not obeyed.