Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Cart
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
25 Feb 2016 at 21:13 UTC
Updated:
16 Apr 2016 at 14:04 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
mglamanPR: https://github.com/drupalcommerce/commerce/pull/342
This ensures we respect attribute dependencies and do not consider variations which do not have matching attributes as we cascade downward.
Comment #3
mglamanThis also preserves any matching attribute selection. Resolving the problem reported in #1286244: Allow dependent attributes to preserve their default options if a matching product exists on an Add to Cart form in 2.x
Comment #4
bojanz commentedCommitted, big thanks!
Comment #6
bojanz commentedReverted.
If you create Red, Blue and Small, Medium attributes, and a variation for each combination, then the new logic will filter by color, then select the first size (Small), making it impossible to ever buy Medium. The tests pass by accident, since there's only one size for the tested Blue color.
Comment #8
bojanz commentedThe reverted patch.
Comment #9
mglamanWOrking on improving the cart and attribute tests.
Comment #10
bojanz commentedmglaman was unable to repeat the bug in the most recent code, but expanded the tests to ensure it doesn't come back:
https://github.com/drupalcommerce/commerce/pull/359
Comment #12
bojanz commentedCommitted.
Comment #13
londova commentedFrom my experience, the system sets the Colour as primary attribute and the Size as secondary. How to change their order? Is there any way to change/setup SIZE as primary attribute and COLOUR as secondary?
I wasn't able to make the price changing while changing the attributes (Add to Cart). What I did wrong?
Comment #14
mglamanBritish-Link, I think if you just re-arrange them on the variants form display.. it might. However I'm not sure. Want to open a follow up for controlling the order of attributes? We can discuss it there. If its a support item, we can open a follow up on https://github.com/drupalcommerce/commerce-docs to add it to the docs.
Comment #15
londova commentedChanging the order on Variants Form Display doesn't have any effect. In my case, the Size is listed as first/upper variant on Form Display and the Color being on second place. However the Add to Cart form will display the Colour as first variant and the Size as second.
I am 100% sure we need facility to control the order of the attributes.
Should I register this as a separate issue?
Comment #16
agoradesign commentedI would say: yes, this is a bug and should be listed as a separate issue. This sounds similar, but still different, as #2691591: ProductVariationStorage::loadEnabled() does not respect field delta, returning items unsorted. I guess, that here also the attributes are queried and/or filtered in a way, that does not respect the weight of the form display configuration
Comment #17
bojanz commentedYou are right. Opened an issue #2699019: Can't change the ordering of attributes with our options. Please provide feedback.