Shopify themes, liquid, logos, and UX
Hey there beautiful people!
Hope you're having a great day!
I have a question related to Shopify Liquid Coding, and I'm hoping that you can help me out a little bit!
Basically, I want to have a text dynamically update when a customer increments the quantity of a product on the cart page, without the page restarting. ( Kind of, like, how the price updates on the cart page when someone increases the quantity of a product, without the page restarting.)
This is what I've done so far:
<div class="cart__footer">
{% if cart.item_count == 1 %}
<p class="grid__item text-right small--text-center">Add another item for 5% discount!</p>
{% elsif cart.item_count == 2 %}
<p class="grid__item text-right small--text-center">Add another item for 10% discount!</p>
{% elsif cart.item_count == 3 %}
<p class="grid__item text-right small--text-center">Add another item for 15% discount!</p>
{% elsif cart.item_count >= 4 %}
<p class="grid__item text-right small--text-center">Hooray! Maximum discount reached!</p>
{% endif %}
</div>
And this actually works, but only if I refresh the page.
What do you think? And ideas?
@alexlaslau – you're half way there, but you need to update the container dynamically using JS, when the input options change. The implementation depends on your theme …
Hope this helps,
Mario
@r8rThank you so much for answering! I'm actually using the Debut theme. How should I address this?
@alexlaslau – have you solved this yet?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024