Shopify themes, liquid, logos, and UX
Hi,
I'm upgrading a site to Shopify 2.0 and I need to reload the Cart page in the Dawn theme when the quantity is changed.
Reason: I currently disable the checkout button and add a message if the cart value is less than £100:
<button type="submit" id="checkout" class="cart__checkout-button button" name="checkout" {% if customer.tags contains 'wholesale' and cart_price < 10000 %} disabled{% endif %} form="cart">
{% if customer.tags contains 'wholesale' and cart_price < 10000 %}
<p>Minimum Wholesale Order is £100.00. To view the check out button please increase your order value.</p>
{% endif %}
In Dawn, because the cart total is dynamically updated when the quantity is changed, the above liquid scripts don't run.
Solution anyone?
Thank you!
Solved! Go to the solution
This is an accepted solution.
Hello @Rich_Woodward ,
Go to Assets => Cart.js and add the below code inside updateLiveRegions function,
window.location.reload();
Next, Go to Sections > main-cart-footer and add your script.
I hope it helps you.
Happy Coding!!
This is an accepted solution.
Hello @Rich_Woodward ,
Go to Assets => Cart.js and add the below code inside updateLiveRegions function,
window.location.reload();
Next, Go to Sections > main-cart-footer and add your script.
I hope it helps you.
Happy Coding!!
Thank you very much for the solution - works perfectly for my needs.
Thanks a lot SheetalZadfiya, it works great!
Hi
Would adding the code:
window.location.reload();
Enable the cart to reload when the customer changes the quantities in the cart. Currently when a customer makes an adjustment, the cart doesn't update the totals including the discounts for volume purchases. If the customer simply refreshes the page it works well but I don't want the customers to have to refresh and it automatically updates when they make the changes.
Thanks in advance
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024