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?
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024