I have a problem with my cart. On my site I sell beers and wine. For beers I would like to replace my checkout button in the cart with a text ad when the total number of beers in the cart is not equal to 6, 12, 18 or 24.
The beers on my site have the tag “beer”
So for the moment i added this code on the “main-cart-footer.liquid” file
I need your help to find how to write the function " When item in cart with product tag isn’t 6, 12, 18 or 24, show the message"
So for the moment i added this code on the “main-cart-footer.liquid” file
{% assign isTagAvailable = false %}
{% for item in cart.items %}
{% if item.product.tags contains ‘beer’ (missing part) %}
{% assign isTagAvailable = true %}
{% endif %}
{% endfor %}
{% if isTagAvailable %}
Hi @Ramijja Please visit the following dummy store I have made logic to your problem. add any product in the cart then see the cart page and try to change the quantity and see checkout button changes.
this will only affect products with beer tags. If there are 2 beers and 4 wines, the button will be disabled. if there are 6 beers and 1 wine, the button will be active.
I will add two products with tags beer and wine to the dummy store. when you like it I will send the step-by-step video guide with the code to implement it in your store.