Zid Themes Docs
  • Getting started
  • Twig reference
  • Theme file structure
  • zid-theme package
  • Theme Templates and Data
    • layout.twig
  • Store language and currency
  • Home template modules
  • Product template
  • Cart template
  • Settings Schema
    • text
    • number
    • textarea
    • select
    • radios
    • checkbox
    • checkboxes
    • range
    • color
    • image
    • product
    • category
    • category products
    • list
    • fieldset
  • Data reference
    • locals
    • store
    • cart
    • product
    • products list
    • category
    • categories list
    • session
    • customer
    • faqs
    • blogs
    • blog
    • page
    • main menu
    • request
    • orders
    • addresses
    • store payment methods
    • store shipping methods
    • store banks
    • asset_url
    • header_meta_tags
  • Zid-api Library
    • Product
    • Category
    • Cart
    • Blog
    • Customer
    • Settings
  • Upload themes and more
Powered by GitBook
On this page

Was this helpful?

  1. Zid-api Library

Cart

fetch function:

no parameter

return: promise

zid.store.cart.fetch().then(function (response) {
		
})

addProduct function:

parameters:

product_id

quantity

options - optional

custom_fields - optional

return: promise

// use this if product is simple
// for more details please check
// https://themes.zid.dev/product-template
zid.store.cart.addProduct({productId, quantity}).then(function (response) {
		
})

// product_id can be passed from onclick function

updateProduct function:

parameters:

product_id

quantity

return: promise

zid.store.cart.updateProduct(product_id, quantity).then(function (response) {
		
})

// product_id can be passed from onclick function

removeProduct function:

parameters:

product_id

return: promise

zid.store.cart.removeProduct(product_id).then(function (response) {
		
})

// product_id can be passed from onclick function

redeemCoupon function:

parameters:

coupon_code

return: promise

zid.store.cart.redeemCoupon(coupon_code).then(function (response) {
		
})

removeCoupon function:

no parameter

return: promise

zid.store.cart.removeCoupon().then(function (response) {
		
})
PreviousCategoryNextBlog

Last updated 3 years ago

Was this helpful?