All things Shopify and commerce
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I have been searching for a solution for my problem from a while, but i couldn't manage to find one. So i recently added a discount app (HulkApps) that gives the customers a certain discount if they buy a certain number of products. For instance, if the customer added one product to the cart, the app tells them that they are one product away from 10% discount and then they can add another item so that they get the discount. The issue is that after they add the additional product the cart doesn't update so that they can see the 10% discount.The only way is to refresh the page manually, but am certain that not all people will do it. I need to make my cart page automatically reload once the quantity of a product has changed. I would appreciate your help.
<script>
$('.qty-input').on('change', function(){
var prev = $(this).data('val');
var current = $(this).val();
setTimeout(function() {
if (prev != current){
location.reload();
}
}, 1);
});
</script>
That's the code that i have tried to use. I placed it in Assets --> cart-template.liquid
I need this too! 😄
Help!