Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
/products/{slug}product_details| Variable | Type |
|---|---|
product | Product |
store | Store |
session | Session |
| Property | Description |
|---|---|
product.id | Product ID |
product.name | Name |
product.slug | URL slug |
product.description | Full description (HTML) |
product.short_description | Brief description |
product.selected_product | Current variant |
product.selected_product.formatted_price | Price |
product.selected_product.formatted_sale_price | Sale price |
product.selected_product.quantity | Stock |
product.selected_product.in_stock | Availability |
product.selected_product.sku | SKU |
product.selected_product.media | Images/videos |
product.variants | Variants |
product.options | Options (size, color) |
product.rating | Rating |
product.reviews | Reviews |
product.questions | Q&A |
product.related_products | Related products |
product.bundle_offer | Bundle offer |
{% extends "layout.jinja" %}
{% block main_content %}
<h1>{{ product.name }}</h1>
{% if product.selected_product.media %}
<img src="{{ product.selected_product.media[0].image.full_size }}" alt="{{ product.name }}">
{% endif %}
<div class="price">
{% if product.selected_product.formatted_sale_price %}
<span>{{ product.selected_product.formatted_sale_price }}</span>
<del>{{ product.selected_product.formatted_price }}</del>
{% else %}
{{ product.selected_product.formatted_price }}
{% endif %}
</div>
{{ product.description | safe }}
{% include 'vitrin:products/variants_list.jinja' %}
<button onclick="zid.cart.addProduct({form_id: 'product-form'})">
{{ _("Add to Cart") }}
</button>
{% endblock %}