Closed (duplicate)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Cart
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2016 at 14:29 UTC
Updated:
16 Sep 2018 at 08:58 UTC
Jump to comment: Most recent
Comments
Comment #2
pontus_nilssonComment #3
pontus_nilssonComment #4
rszrama commentedI can confirm. It appears the Add to Cart form builder does not use unique form IDs in 2.x like it did in 1.x. This means Drupal is simply submitting the first matching form it finds. Duplicated on my site, will talk w/ Matt about how that worked in 1.x if he's unclear.
Comment #5
niko- commentedHi
Patch for this issue https://www.drupal.org/node/2796669#comment-11613019
Comment #6
pontus_nilssonComment #7
mglamanClosing this as a duplicate of #2796669: Price not updated for variations when products shown in list views, as it should be fixed in there. Basically the merge is halted by drupal_ti and Travis tests failing.
Comment #8
hansfn commentedI have grabbed the latest dev version of Commerce and this issue is not fixed.
Doing as the OP suggested still shows the problem - wrong product added. This seems to a off-by-one problem. ADDED: Or it seems the ids are running in the wrong order - opposite for the article element and the add-to-cart div/form element.
Sample HTML code generated for product 2:
I guess you see the offset and using "Add to cart" adds the wrong product. I'm looking at the code, but any help is very much appreciated.
Comment #9
drugan commentedDid you try this?
The #2796669: Price not updated for variations when products shown in list views is marked as fixed but appears that it is not. The main reason for this issue is wrong id on Add to Cart forms. Things will become more complicated if you have duplicated carts(the same product) on a page. The solution above resolves this issue too. Just do not forget to disable views caches on the each next view (page or block) which has the same Add to Cart forms as the previous one.
Comment #10
hansfn commentedThx a lot, drugan! Your patch in commit 21 in #2827721: AddToCartForm should support all purchasable entities fixed the issue for me. I consider this issue to be a duplicate of that issue - closing it again.
Comment #11
hansfn commentedComment #12
Anonymous (not verified) commentedHello, I have problems with product selection. Drupal core 7.59, Module Cart 7.x-1.8 + Commerce add to cart confirmation. When adding to the shopping cart the confirmation window has a) the right prices and the right product photo or b) a window with quantity and price only. The real problem is with the shopping cart. There are usually other products displayed as customer has selected. Looks like the problem solved with drupal 8.x (Form ID?). Would it be possible to provide a patch for version 7.x.? Thank you.
Comment #13
Anonymous (not verified) commented