Add to cart disables when changing variations

My add to cart button disables itself when i change to a different variation. This also means the “buy now” button vanishes.

This just started happening a few days ago - if i reload the page of variation 2 (by clicking in address bar and hitting return) the buttons are showing and enabled - so this is just happening on the postback.

All the variations are in stock and should be showing and available.

Looking into the liquid i see this bit in main-product.liquid

{%- form 'product', product, id: product_form_id, class: 'form', novalidate: 'novalidate', data-type: 'add-to-cart-form' -%}
                  
                  

                    
                    {%- if block.settings.show_dynamic_checkout -%}
                      {{ form | payment_button }}
                    {%- endif -%}
                  

                {%- endform -%}
              

The add button has a class added to it called “zip” that i added to check this was the correct code being output, what’s happening is that the “disabled=‘disabled’” tag is being added to the button on the postback.

This code has a couple of clauses that may add this tag - but these are NOT adding it in this case (i tried removing them to test) but something is adding it.

One thing - i renamed the add button from “add” to “addx” in the template - when i do this it then works perfectly and continues to do so after postback, however this isn’t a great solution as it’ll mean the button won’t ever disable (when for example, out of stock)

Anyone have any ideas? i’m all out…

When strange behaviours like this happens, I usually ask the store owner:

  • if a new app has been installed/set up recently. Apps sometimes mess up with regular behavious

  • if there are any JS errors in the console. Sometimes broken JS code can cause other JS code to break

Is this the case?

hi, no new apps and no errors in the console…

If you can post the link, that’d be great