Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Commit

Permalink
No need to add data-id to product quantity select
Browse files Browse the repository at this point in the history
  • Loading branch information
cshold committed Apr 28, 2014
1 parent 0c1c10b commit 4d57f9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions assets/ajaxify.js
Expand Up @@ -942,7 +942,7 @@ var ajaxifyShopify = (function(module, $) {

qtySelectors = function() {
// Change number inputs to JS ones, similar to ajax cart but without API integration.
// Make sure to add the existing ID to the new input element
// Make sure to add the existing name and id to the new input element
var numInputs = $('input[type="number"]');

if (numInputs.length) {
Expand All @@ -952,9 +952,6 @@ var ajaxifyShopify = (function(module, $) {
inputName = el.attr('name'),
inputId = el.attr('id');

// Ignore inputs without a data-id
if (!el.attr('data-id')) return false;

var itemAdd = currentQty + 1,
itemMinus = currentQty - 1,
itemQty = currentQty;
Expand Down
5 changes: 1 addition & 4 deletions templates/product.liquid
Expand Up @@ -139,10 +139,7 @@
Quantity selector is optional
{% endcomment %}
<label for="quantity">Qty: </label>
{% comment %}
Added data-id for the ajax cart implementation only.
{% endcomment %}
<input type="number" id="quantity" name="quantity" value="1" min="1" data-id="{{ product.id }}">
<input type="number" id="quantity" name="quantity" value="1" min="1">

<input type="submit" name="add" class="btn" id="addToCart" value="Add to Cart">
</form>
Expand Down

0 comments on commit 4d57f9f

Please sign in to comment.