Update Cart in Boundless

Salim003
New Member
2 0 0

I'm working in the Boundless theme for my store. I want to have a gift wrapping option (https://shopify.dev/tutorials/customize-theme-add-gift-wrap-option) with a checkbox in the slide out cart that comes from the right. I have it to when the box gets checked the option is added to the cart, but only when you refresh the page or go to the checkout. I want the item to added to the slide out cart in realtime just the gift wrapping option in the link above. 

<script>
    /*6590925701297*/
    function giftWrapping(){
      jQuery.post('/cart/add.js', 
      {
        items: [	
          {
            quantity: 1,
            id: 39394015510705
          }
        ]
      });
    alert("Updated jQuery");
    } 

   


    
  </script>

Here the code I'm using with an onchange function on the input checkbox for giftWrapping().

Anybody know what I'm doing wrong? 

0 Likes