Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
Note: For functions that require a product_idparameter, this parameter can be obtained from user interactions within the theme. Anonclickevent handler in your theme's interactive elements, such as buttons or images, can capture and pass theproduct_idto these functions.
fetchzid.store.cart.fetch().then(function (response) { /* Handle response */ });addProductproduct_idquantityoptions (optional)custom_fields (optional)zid.store.cart.addProduct({ productId, quantity }).then(function (response) { /* Handle response */ });updateProductcart_product_id - The identifier for the product entry within the cart (cart.products[].id in the Cart payload.quantity - The new quantity of the product.product_id - The original product identifier (cart.products[].product_id in the Cart payload.zid.store.cart.updateProduct(cart_product_id, quantity, product_id).then(function (response) { /* Handle response */ });removeProductcart_product_id - The identifier for the product entry within the cart (cart.products[].id in the Cart payload.product_id - The original product identifier (cart.products[].product_id in the Cart payload.zid.store.cart.removeProduct(cart_product_id, product_id).then(function (response) { /* Handle response */ });redeemCouponcoupon_codezid.store.cart.redeemCoupon(coupon_code).then(function (response) { /* Handle response */ });removeCouponzid.store.cart.removeCoupon().then(function (response) { /* Handle response */ });