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 ?
| Comment | File | Size | Author |
|---|---|---|---|
| ajax-add-to-card-bad.jpg | 68.75 KB | motame | |
| ajax-add-to-card-good.jpg | 77.3 KB | motame |
Comments
Comment #2
subhojit777I 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.
Comment #3
motame commentedIndeed! I had just to configure the display.
Thank you.
Comment #4
subhojit777Comment #6
derekcresswell commentedHello. I've got the same problem and not sure what exactly you mean I need to do.
/admin/commerce/config/product-types/standard/edit/displayI 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?
Comment #7
subhojit777take a look here https://docs.drupalcommerce.org/commerce2/developer-guide/products/displ... I guess this should help you.
Comment #8
derekcresswell commentedAh 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!
Comment #9
filipetakanap commentedThank you my god DEREKCRESSWELL!!