Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
This page documents the new Vitrin product functions and explains the arguments needed to use them (with the matching old Zid call where relevant).
window.vitrin.products
.vitrin.products.list(params?)
zid.store.product.fetchAll(filters)
params
(object, optional):page?
(number)page_size?
(number)q?
(string) — search querycategories?
(string)price_min?
(string), price_max?
(string)on_sale?
(boolean)attribute_values?
(string[])vitrin.products.get(product_id)
zid.store.product.fetch(id)
vitrin.products.getProductOptions(product_id, params?)
product_id
(string, required) — Product identifier.params
(object, optional):attributes
(object) — Map of attribute_id
→ attribute_value_id
(UUIDs).option_fields
(object) — Map of option_group_id
→ array of selected option_id
s (UUIDs).input_fields
(string[]) — Array of input_field_id
s (UUIDs) that currently have values.
IDs come from the product object (all are UUIDs).
vitrin.products.reviews(product_id, { page?, page_size? })
zid.store.product.getReviews(id, page)
product_id
(string, required)params
(object, optional):page?
(number)page_size?
(number)vitrin.products.createReview(product_id, payload)
zid.store.product.addReview(id, reviewForm, rating, is_anonymous)
product_id
(string, required)payload
(object, required):rating
(number, required) — 1..5comment?
(string)is_anonymous?
(boolean)order_id?
(string)images?
(File[])vitrin.products.createQuestion(product_id, payload)
zid.store.product.addQuestion(id, question, name, email, is_anonymous)
product_id
(string, required)payload
(object, required):name
(string, required)email
(string, required)question
(string, required)is_anonymous?
(boolean)vitrin.products.getCustomerReviews({ product_id })
zid.store.product.getCustomerReviews(id, orderId)
params
(object, required):product_id
(string, required)Change: orderId
is not used in the new API.
attributes
, option_fields
, input_fields
) are UUIDs from the product object. They are provided dynamically, you don’t hardcode them.