Closed (works as designed)
Project:
Commerce Ajax Add to Cart
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Feb 2015 at 12:32 UTC
Updated:
14 Jun 2017 at 06:57 UTC
Jump to comment: Most recent
Comments
Comment #1
joe huggansComment #2
joe huggansWe are willing to pay to get this sorted ASAP. Anyone?
Comment #3
saurabh.dhariwal commentedHello,
Follow the steps provided below.
Create new taxonomy named "Pizza Toppings", and add new field Price in it.
Add terms in "Pizza Toppings" like Cheese, Garlic etc with associative price.
Add new field in line item (Product) with term reference(Pizza Toppings).
Tick "Include this field on Add to Cart forms for line items of this type" checkbox under "ADD TO CART FORM SETTINGS".
This will display your "Pizza toppings" terms on add to cart form.
Now create new "Product Pricing rule" from Store > Configuration > Product Pricing Rule.
1) Select event "Calculating the sell price of a product".
2) Add Condition "Entity has field" with Data selector "commerce-line-item" and field "field_pizza_toppings"
3) In Action section, add Loop for pizza toppings of commerce line item.
> Add action under Loop to "Add an amount to the unit price" with data selector as commerce_line_item and for AMOUNT take pizza toppings amount.
> Select fee from drop down as "PRICE COMPONENT TYPE".
This will add your selected toppings price into your line item total.
Let me know incase of any query/concern regarding this.
Thanks!
Comment #4
joe huggansThanks Alot! Will try this out soon
Comment #5
dgregory commentedI see that this is an old post, but hope to receive a hand.
I've run into a similar issue and am attempting to do these steps. I've completed all steps as stated in your directions saurabh.dhariwal but I am stuck at the step for adding the action (beneath the created loop). I chose the data selector: "commerce_line_item", but then for the AMOUNT section, cannot find a data selector for my field for amount. So in your example, I believe you are saying that the data selector that should be selected would be "commerce-line-item:field-pizza-toppings:amount", but I cannot find this for my field. I attempted to just add the commerce line item data selector for mine, but it does not accept this.
Have I missed an important step in which an "...:amount" data selector would have been created?
Thanks for your support!
Comment #6
subhojit777Same as @saurabh.dhariwal's steps, but improved and more verbose:
commerce-line-item:field-pizza-toppingsdata selector. Say, the variable name ispizza_toppingcommerce_line_itemand for AMOUNTpizza-topping:field-price:amountComment #7
subhojit777Related bugs are created #2886007: Shopping cart showing incorrect amount when used with pricing attributes #2886008: Popup message showing incorrect amount when used with pricing attributes
Closing this issue