I want to hide checkout buttom if cart.total_price is under $2000. I could do it with a liquid conditional in cart-template.liquid, so when user goes to his cart and its total is under $2000, checkout button is hidded. My problem is that I know that in this solution a page refresh is needed. I want to hide or show checkout button when user increase or decrease a cart item quantity without refresh the page. It’s that posible? I am using Debut theme.
Hi, @flaquitqm .
You could achieve that using the AJAX Api for the cart.
https://shopify.dev/api/ajax/reference/cart
Hi @flaquitqm ,
You have to edit cart.js find the below line
fetch(`${routes.cart_change_url}`, { ...fetchConfig(), ...{ body } })
and write your condition in its success state.
Hope it helps…
1 Like