Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Make quantity read only for the Empire theme
{% if has_items %}
document.addEventListener("DOMContentLoaded", function(event) {
{% for item in cart.items %}
$('.cart-item--quantity:nth-child({{ forloop.index }})')
.append({{ item.quantity }})
.append('<input type="hidden" value="{{ item.quantity }}" name="updates[]" id="updates_{{ item.key }}">');
{% endfor %}
{% endif %}
Copy link

gterrill commented Feb 13, 2018

Add this code to the end of the sections/static-cart.liquid file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment