Products
This section details the APIs available for handling products in the Zid Themes Library.
Fetch All Products
Function:Â fetchAll
Description: Retrieves a list of products based on specified criteria.
Parameters:
catId
: Category ID (passÂnull
 for products from all categories).query
: JSON object with the following properties:page
: Pagination page number.per_page
: Number of items per page.search
: Search term for product name or SKU.on_sale
:Â0
 orÂ1
 to filter sale items.sort_by
: Sorting criteria (display_order
,Âcreated_at
,Âpopularity_order
,Âprice
).order
: Sort order (asc
,Âdesc
).from_price
: Minimum price filter.to_price
: Maximum price filter.
Usage:Â zid.store.product.fetchAll(catId, query).then(function (response) { /* Handle response */ });
Fetch Specific Product
Function:Â fetch
Description: Retrieves details of a specific product or product variant.
Parameters:
id
: Product ID or variant ID.
Usage:Â zid.store.product.fetch(id).then(function (response) { /* Handle response */ });
Get Product Reviews
Function:Â getReviews
Description: Fetches reviews for a specified product.
Parameters:
product_id
: The main product ID.page
: Pagination page number.
Usage:Â zid.store.product.getReviews(product_id, page).then(function (response) { /* Handle response */ });
Add Product Review
Function:Â addReview
Description: Adds a review to a product.
Parameters:
id
: Main product ID.comment
: Review comment.rating
: Review rating.is_anonymous
: Boolean to indicate if the review is anonymous.
Usage:Â zid.store.product.addReview(id, comment, rating, is_anonymous).then(function (response) { /* Handle response */ });
Note: TheÂ
product_id
 can be passed from anÂonclick
 function in your theme's interactive elements.
Get Product Bundle Offer
Function:Â getProductBundleOffer
Description: Retrieves bundle offers associated with a product.
Parameters:
id
: Main product ID.
Usage:Â zid.store.product.getProductBundleOffer(id).then(function (response) { /* Handle response */ });