Closed (fixed)
Project:
Commerce Ajax Add to Cart
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Oct 2017 at 14:45 UTC
Updated:
1 Nov 2017 at 06:29 UTC
Jump to comment: Most recent
Comments
Comment #2
maen commentedComment #3
subhojit777The logic to get the last line item is nice. But I would like to replicate the problem on my end. What do you mean by Because the line_items were concatenated?
Comment #4
subhojit777Comment #5
maen commentedI use Commerce Customizable Products to have line item fields in the product form. When I add the exact same product multiple times to cart they were gathered in 1 line item. So I do not see the last added product, instead I see the last product which was added with a different price.
For example:
I buy 1 white shirt -> 3 $. -> correct display.
I buy 1 black shirt -> 4 $. -> correct display.
I buy 1 white shirt-> 3 $. -> shows the black shirt in the pop-up display. -> wrong!
That's it.
The db table "commerce_line_item" sets the quantity from 1 to 2.
Comment #6
stockticker commentedGot a similar issue, when ajax pop-up message showed wrong items (not that products, where 'add to cart' button was pressed on).
However, piece of code, that maen provided - worked like a charm.
Many thanks!
Comment #7
subhojit777Comment #9
subhojit777