{{ cart.item_count }} update with AJAX cart

New Member
7 0 0


Could you please help me with one store.

www.sarkozy.lt has a check of cart items on the checkout page based on {{ cart.item_count }} value. Unfortunately, it doesn't get updated with AJAX cart update, when customer change quantity on the shopping cart. Is there a way to update that {{ cart.item_count }} value with the cart quantity update?

The code for checkout button is this:



{% if cart.item_count > 5 %}

<button type="submit" name="checkout" class="btn btn--loader" data-cart-submit>
{{ 'cart.general.checkout' | t }}
<span class="btn--loader-balls"></span>

{% else %}<p> Uh Oh! The minimum order is 6 items of any cider. Please add more. Now you have <strong>{{ cart.item_count }}</strong> items. </p>

{% endif %}



I've figured out that there are some "cart-data-*" elements that I could use to get cart data like list of items, subtotal, etc., but I couldn't find one that could return me updated cart item count.

Thank you very much in advance.

-- Vaidas