Gift-wrap option in cart - Updating/Resetting Other Custom Cart Elements

SweetDis
New Member
2 0 0

Hello,

I am using the shopify tutorial to adding gift-wrapping functionality.

https://shopify.dev/tutorials/customize-theme-add-gift-wrap-option

This works well however I am encountering an issue in that when the gift wrapping is added to the cart it updates not only the products by adding the gift wrapping and updating the cart total but it also wipes/updates the other custom elements I have in my cart

  • Special instructions to seller (textarea) is reset
  • Date Picker (from Supertime app) is reset 
  • it re-hides the text area for the gift note which I have hidden until the customer selects they want gift wrapping 

I have very limited experience with this but I suspect that as the gift.wrapping liquid is using the cart/update.js this is overriding my other custom elements every time the customer checks the gift wrapping box. I've tried the other cart APIs but I'm clearly not knowledgeable enough to solve this.

Any help would be much appreciated.

I'm using the Brooklyn theme

Josh

0 Likes