This section details the functions related to the shopping cart in the Zid Themes Library.
Note: For functions that require a product_id parameter, this parameter can be obtained from user interactions within the theme. An onclick event handler in your theme's interactive elements, such as buttons or images, can capture and pass the product_id to these functions.
Function: fetchDescription: Retrieves the current contents and data of the shopping cart, including products, pricing, applied coupons and offers, and other related attributes.Usage: zid.store.cart.fetch().then(function (response) { /* Handle response */ });
Function: addProductDescription: Adds a product to the cart. Useful for simple products, i.e., products with neither variants nor custom input fields. For complex products, refer to the Products Template documentation.Parameters:
Function: removeCouponDescription: Removes any currently applied coupon from the cart.Usage: zid.store.cart.removeCoupon().then(function (response) { /* Handle response */ });