Redirect to Shopping Cart after "add to cart"

Description

  • Users click add to cart >> add product to cart
  • open /cart page

If code doesn’t work, you can comment below, message or email me.
#1. All Products

You can Use this code to Code Injection > Footer

<script>
document.addEventListener('click', function(e) {
  if (e.target.matches('.sqs-add-to-cart-button')) {
    setTimeout(function() {
      window.location.href = '/cart';
    }, 3000);
  }
});
</script>

3000 = 3 seconds.

#2. Specific Product

If you want to do this on specific product, you can add a tag: rdtcart and assign it to products.

Next, use this code to Code Injection > Footer

<script>
document.addEventListener('click', function(e) {
  if (e.target.matches('.tag-rdtcart .sqs-add-to-cart-button')) {
    setTimeout(function() {
      window.location.href = '/cart';
    }, 3000);
  }
});
</script>

1 Like