When changing from "Add to cart form" to "Ajax add to cart form", the ajaxified add to cart works perfectly.
However the product variation block is changed from two select fields, two product attributes (see attached screenshot ajax-add-to-card-good.jpg) to one select field with the variation title, combined attributes (see attached screenshot ajax-add-to-card-bad.jpg). Note that the autocomplete feature is added by a module when the number of the select options exceeds some limit.
What do you suggest to get back the product variation to a two select fields, Model and Color ?

Comments

motame created an issue. See original summary.

subhojit777’s picture

I am using Commerce's commerce cart - see https://git.drupalcode.org/project/dc_ajax_add_cart/blob/8.x-1.x/src/Ref... for the ajaxified cart. Therefore, I think that form display needs to be configured from the block. There is no need to change any code in the module.

motame’s picture

Indeed! I had just to configure the display.
Thank you.

subhojit777’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

derekcresswell’s picture

Hello. I've got the same problem and not sure what exactly you mean I need to do.

/admin/commerce/config/product-types/standard/edit/display I go under the sub-tab default and set Variations to 'Ajax add to cart form'.

Do you mean to say that on the same page go to one of the cart sub-tabs? Or over to form-display. I tried tinkering for about 20 minutes and couldn't seem to fix this. Could you provide more details?

subhojit777’s picture

derekcresswell’s picture

Ah ok it was under my order item type's form display. The Ajax add to cart had "Unit Price" active and that messed it up. Thanks!

filipetakanap’s picture

Thank you my god DEREKCRESSWELL!!