templates/website/page/hertiage-product.html.twig line 1
{% extends '@web/base.html.twig' %}{% block body %}<section class="main-products-section"><div class="container-fluid"><div class="row"><div class="col-lg-10 m-auto"><ul class="wrapper-navigation"><li><a href="{{ path('page_index') }}">{{ 'Home'|trans }}</a></li><li><a href="{{ path('page_heritage_products') }}">{{ 'Products'|trans }}</a></li><li><span>{{ product.title }}</span></li></ul><div class="section-product-view"><div class="wrapper-product-view-content"><div class="wrapper-image">{# 1️⃣ Build safe images array (skip null automatically) #}{% set images = [] %}{% if product.image %}{% set images = images|merge([product.image]) %}{% endif %}{% if product.minImage %}{% set images = images|merge([product.minImage]) %}{% endif %}{% if product.miniSecondImage %}{% set images = images|merge([product.miniSecondImage]) %}{% endif %}{# 2️⃣ If all images are null → show placeholder #}{% if images is empty %}{% set images = ['images/no-image.png'] %}{% endif %}{# MAIN SLIDER #}<div class="swiper product-main-slider"><div class="swiper-wrapper">{% for img in images %}<div class="swiper-slide"><img src="{{ asset(img) }}" alt="product image"></div>{% endfor %}</div></div>{# THUMB SLIDER #}<div class="swiper product-thumb-slider"><div class="swiper-wrapper">{% for img in images %}<div class="swiper-slide"><img src="{{ asset(img) }}" alt="product thumbnail"></div>{% endfor %}</div></div></div><div class="wrapper-description"><h2>{{ product.title }}</h2><ul><li><span>{{ 'Category'|trans }}:</span><strong>{{ product.category.title }}</strong></li><li><span>{{ 'Collection'|trans }}:</span><strong>{{ product.collection.title }}</strong></li><li><span>{{ 'Weight'|trans }}:</span><strong>{{ product.weight }}</strong></li><li><span>{{ 'Material'|trans }}:</span><strong>{{ product.type }}</strong></li>{% if product.stone %}<li><span>{{ 'Stones'|trans }}:</span><strong> {{ product.stone }}</strong></li>{% endif %}</ul><div class="wrapper-bottom"><h4>{{ product.price|number_format ~ ' դրամ' }}</h4><button class="main-shop-btn">{{ 'ADD TO CARD'|trans }}<svg width="20" height="17" viewBox="0 0 20 17" fill="none"xmlns="http://www.w3.org/2000/svg"><path d="M15.9987 11.8333H5.16536L3.08203 3.5H18.082L15.9987 11.8333Z"fill="#0F0F0F"></path><path d="M1 1H2.45833L3.08333 3.5M3.08333 3.5L5.16667 11.8333H16L18.0833 3.5H3.08333Z"stroke="#0F0F0F" stroke-width="2" stroke-linecap="round"stroke-linejoin="round"></path><path d="M5.16797 16C5.85832 16 6.41797 15.4404 6.41797 14.75C6.41797 14.0596 5.85832 13.5 5.16797 13.5C4.47761 13.5 3.91797 14.0596 3.91797 14.75C3.91797 15.4404 4.47761 16 5.16797 16Z"stroke="#0F0F0F" stroke-width="2" stroke-linecap="round"stroke-linejoin="round"></path><path d="M16 16C16.6904 16 17.25 15.4404 17.25 14.75C17.25 14.0596 16.6904 13.5 16 13.5C15.3096 13.5 14.75 14.0596 14.75 14.75C14.75 15.4404 15.3096 16 16 16Z"stroke="#0F0F0F" stroke-width="2" stroke-linecap="round"stroke-linejoin="round"></path></svg></button></div></div></div>{% if product.productDescription %}<div class="wrapper-additional-information"><h3>{{ 'Description'|trans }}</h3>{{ product.productDescription }}</div>{% endif %}<div class="wrapper-additional-information"><h3>{{ delivery.title }}</h3>{{ delivery.description|raw }}</div></div><div class="wrapper-recent-products"><h5>{{ 'YOU MIGHT ALSO LIKE'|trans }}</h5><div class="swiper mySwiper"><div class="swiper-wrapper">{% for item in products %}<div class="swiper-slide"><a href="{{ path('page_heritage_product_view',{'id':item.id}) }}"class="wrapper-item"><div class="wrapper-image"><img src="{{ item.image }}" alt=""></div><span class="wrapper-description"><strong>{{ item.title }}</strong><span>{{ item.price|number_format ~ ' դրամ' }}</span></span></a></div>{% endfor %}</div></div></div></div></div></div></section>{% endblock %}