Skip to content

Instantly share code, notes, and snippets.

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

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.