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.zid.products.zid.products.get(product_id)zid.store.product.fetch(id)zid.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_ids (UUIDs).input_fields (string[]) — Array of input_field_ids (UUIDs) that currently have values.IDs come from the product object (all are UUIDs).
zid.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)zid.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[])zid.products.getCustomerReviews({ product_id })zid.store.product.getCustomerReviews(id, orderId)params (object, required):product_id (string, required)Change: orderIdis not used in the new API.
zid.products.questions(product_id, params?)product_id (string, required) — Product identifier.params (object, optional) — Optional query parameters:page (number) — Page number for pagination.page_size (number) — Number of questions per page.zid.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)zid.products.bundleOffers(params?)zid.store.product.getProductBundleOffer(id)params (object, optional):product_ids (array, optional)zid.products.stockAlerts({ product_id }, payload)product_id (string, required) — Product identifier.payload (object, required) — Subscription details containing customer information.customer_email (string, required) — Customer's email address for notifications.customer_phone_number (string, optional) — Customer's phone number.customer_name (string, optional) — Customer's name.zid.products.getBundleOffer(product_id)product_id (string, required) — Product identifier.attributes, option_fields, input_fields) are UUIDs from the product object. They are provided dynamically, you don’t hardcode them.