Products
Fetch All Products
fetchAll
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.zid.store.product.fetchAll(catId, query).then(function (response) { /* Handle response */ });
Fetch Specific Product
fetch
id
: Product ID or variant ID.zid.store.product.fetch(id).then(function (response) { /* Handle response */ });
Get Product Reviews
getReviews
product_id
: The main product ID.page
: Pagination page number.zid.store.product.getReviews(product_id, page).then(function (response) { /* Handle response */ });
Add Product Review
addReview
id
: Main product ID.comment
: Review comment.rating
: Review rating.is_anonymous
: Boolean to indicate if the review is anonymous.zid.store.product.addReview(id, comment, rating, is_anonymous).then(function (response) { /* Handle response */ });
Note: The product_id
can be passed from anonclick
function in your theme's interactive elements.
Get Product Bundle Offer
getProductBundleOffer
id
: Main product ID.zid.store.product.getProductBundleOffer(id).then(function (response) { /* Handle response */ });
Modified at 2024-11-05 12:46:25