title: Shopify cart reduce quantity Ajax opposite of Shopify.addItem()
body: <p>For transparency: this is an exact copy of a request that I have made in a Shopify forum, but I did not get any help there (except for an expensive offer to solve the issue...).</p>
  <p>I own a Shopify store that uses a popup cart before checkout. I am using the following code on the popup cart, in order to enable customers to increase or decrease the quantity of items in the cart:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="input-group m-0"&gt;
        &lt;input type="button" value="-" class="button-minus" data-field="quantity"&gt;
        &lt;input id="{{ item.variant.id }}" type="number" step="1" max="" value="{{ item.quantity }}" name="quantity" class="quantity-field"&gt;
        &lt;input type="button" value="+" class="button-plus" data-field="quantity" onclick="Shopify.addItem({{ item.variant.id }}, 1)"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>As you might see I am using the Shopify.addItem() function when onclick is triggered in order to increase the amount of items per product in the cart. This function really works. Sadly I did not find any function to reduce the quantity by 1. So therefore I wrote some JavaScript, but it sadly does not work. Find the code here:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.input-group').on('click', '.button-minus', function(e) {
      e.preventDefault();
      var fieldName = $(e.target).data('field');
      var parent = $(e.target).closest('div');
      var currentVal = parseInt(parent.find('input[name=' + fieldName + ']').val(), 10);
      var currentVariant = parseInt(parent.find('input[name=' + fieldName + ']').attr('id'), 10);
      jQuery.post('/cart/change.js', { quantity: currentVal - 1, id: currentVariant });    
  });</code></pre>
  </div>
  </div>
  </p>