Liquid, JavaScript, themes, sales channels
Hello, I have added the below logic to my cart based on the item vendors as follows. This code works fine for the regular cart page but I also have an ajax cart using code similar to https://github.com/Shopify/Timber/blob/master/snippets/ajax-cart-template.liquid. If I try to add the below code to this template, the items do not update without a hard page refresh. Can anyone tell me how to access the cart items in javascript for the ajax cart, similar to what I've done below?
{% assign isGlobalShipAvailable = true %} {% for item in cart.items %} {% if item.vendor == 'SOME_VENDOR' %} {% assign isGlobalShipAvailable = false %} {% endif %} {% endfor %} {% if isGlobalShipAvailable %} DO_SOMETHING {% endif %}
Well I dug into this some more and I have a better handle on it (no pun intended) but I need to dig into handlebars.js and I think I can make something work.
User | RANK |
---|---|
38 | |
28 | |
13 | |
13 | |
10 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023