Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to cart does not work with JS disabled #179

Closed
bakura10 opened this issue Jul 14, 2021 · 2 comments · Fixed by #210 or #736
Closed

Add to cart does not work with JS disabled #179

bakura10 opened this issue Jul 14, 2021 · 2 comments · Fixed by #210 or #736
Assignees

Comments

@bakura10
Copy link

Hi,

As of today Dawn output a select: https://github.com/Shopify/dawn/blob/main/sections/main-product.liquid#L235

However another one is set in the product form: https://github.com/Shopify/dawn/blob/main/sections/main-product.liquid#L260

Because you cannot have two input with the same name, in this situation the last one (depending on the block order) will take the control, and as add to cart is typically after selectors, only the add to cart one will win.

Dawn add to cart form with non JS is therefore currently stuck to the first available variant.

I think Dawn should make sure that the name="id" only exists once within the form and be synchronized in JS.

@tomatic
Copy link

tomatic commented Jul 14, 2021

The problem seems to be that the select that's rendered in <noscript> isn't contained within the form, therefore the product with the id that's set in a hidden form field within the form is used. If JS is active, changing the variant changes the value in that hidden field, but without JS the id always stays the same.

@colinloretz
Copy link

+1 We are using our own theme built on Dawn and ran into this with a live customer. Going to go ahead and update our version to fix this but definitely a fix should be considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants