I think the correct label would be "Line item product contains specific terms ID".
The reason I want this to be changed is that I would like to create a module that extend this one by looking into custom line items terms (and not product terms).
With Commerce Customizable Products, you can add term reference field to a line item and expose them to the cart form.
My purpose is to have a condition which will be "Line item contains specific terms ID", and which actually look into line item entity (and not product attached to) for taxonomy fields.
For example, for a tour registration product, you could add discount conditions with a select form (age, pass, resident, etc...) which change the price of the line item, without having to create all combination of product.
Comment | File | Size | Author |
---|---|---|---|
#2 | inline_condition-handle_custom_line_item_types-2091813-2.patch | 4.37 KB | jkuma |
#1 | 2091813-line_item_condition-1.diff | 5.86 KB | camdarley |
Comments
Comment #1
camdarley CreditAttribution: camdarley commentedOk, instead of a new module, I made a patch covering this issue.
It seems to do the job.
Comment #2
jkuma CreditAttribution: jkuma commentedHi camdarley,
Thanks for your contribution, but your patch doesn't follow the guidelines exposed in commerce_product.inline_conditions.inc. Indeed, you are sorting out the taxonomy fields from commerce_line_item entity type without testing if it's related to a product (=> if commerce_product field is attached). I can't commit your patch for that reason.
However, I've decided to refactor the conditions build callbacks and support the custom line item types as exposed in Commerce Customizable Products.
Your issue should be fixed with the patch attached. This patch works for every line item types that implement a commerce_product field, so I don't test the bundle anymore, but I check if the commerce_product field is attached on the passed entity.
Comment #3
jkuma CreditAttribution: jkuma commentedComment #4
jkuma CreditAttribution: jkuma commentedComment #5
jkuma CreditAttribution: jkuma commentedComment #6
jkuma CreditAttribution: jkuma commentedPushed into 7.x-1.x branch