Answers for "clear cart shopify"

0

clear cart shopify

<a href="/cart/clear" class="btn clear-cart">Empty Cart</a>

<script>
$(function() {
  $('.clear-cart').on('click',function(e){
    e.preventDefault();
    $.ajax({
      type: "POST",
      url: '/cart/clear.js',
      success: function(){
        alert('You cleared the cart!');
      },
      dataType: 'json'
    });
  })
});
</script>
Posted by: Guest on October-06-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language