title: Shopify - Cart.js not adding product to cart
body: <p>Currently I'm trying to get Shopify's cart.js to add my products to cart. </p>
  
  <p>It used to work perfectly but when I added variants it's started to break and for the life of me I can't get it to work. When clicking the button - it doesn't add the product to the bag at all.</p>
  
  <pre><code>  &lt;form action="/cart/add" method="post" data-cart-submit&gt;
      {% if product.variants.size &gt; 1 %}
        &lt;div class="w-form"&gt;
          &lt;div class="inpost-form-option w-clearfix"&gt;
            &lt;label class="inpost-form-label"&gt;{{ product.options.first }}&lt;/label&gt;
            &lt;select id="variant-select" class="inpost-quantity w-select"&gt;
                  {% for variant in product.variants %}
                      {% if variant.available == true %}
                          &lt;option value="{{ variant.id }}"&gt;{{ variant.title }}&lt;/option&gt;
                      {% endif %}
                  {% endfor %}
              &lt;/select&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        {% endif %}
        &lt;button class="inpost-buy w-button" type="submit" data-cart-add="{{ variant.id }}"&gt;Add to Bag →&lt;/button&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>Added Javascript</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      jQuery(function() {
          CartJS.init({{ cart | json }});
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Console Error</p>
  
  <blockquote>
    <p>shop_events_listener-91b4691….js:1 POST
    <a href="https://monah-uk.myshopify.com/cart/add.js" rel="nofollow noreferrer">https://monah-uk.myshopify.com/cart/add.js</a> 404 (Not Found)</p>
  </blockquote>