templates/website/page/hertiage-product.html.twig line 1

  1. {% extends '@web/base.html.twig' %}
  2. {% set metaParams = {
  3.     'title': product.metaTitle,
  4.     'description': product.metaDescription,
  5.     'keywords': product.metaDescription,
  6.     'ogImage': product.metaImage,
  7. } %}
  8. {% block meta %}
  9.     {% include '@web/parts/meta.html.twig' with metaParams %}
  10. {% endblock meta %}
  11. {% block title %}{{ product.metaTitle }}{% endblock title %}
  12. {% block body %}
  13.     <section class="main-products-section">
  14.         <div class="container-fluid">
  15.             <div class="row">
  16.                 <div class="col-lg-10 m-auto">
  17.                     <ul class="wrapper-navigation">
  18.                         <li>
  19.                             <a href="{{ path('page_index') }}">
  20.                                 {{ 'Home'|trans }}
  21.                             </a>
  22.                         </li>
  23.                         <li>
  24.                             <a href="{{ path('page_heritage_products') }}">
  25.                                 {{ 'Products'|trans }}
  26.                             </a>
  27.                         </li>
  28.                         <li>
  29.                             <span>{{ product.title }}</span>
  30.                         </li>
  31.                     </ul>
  32.                     <div class="section-product-view">
  33.                         <div class="wrapper-product-view-content">
  34.                             <div class="wrapper-image">
  35.                                 {# 1️⃣ Build safe images array (skip null automatically) #}
  36.                                 {% set images = [] %}
  37.                                 {% if product.image %}
  38.                                     {% set images = images|merge([product.image]) %}
  39.                                 {% endif %}
  40.                                 {% if product.minImage %}
  41.                                     {% set images = images|merge([product.minImage]) %}
  42.                                 {% endif %}
  43.                                 {% if product.miniSecondImage %}
  44.                                     {% set images = images|merge([product.miniSecondImage]) %}
  45.                                 {% endif %}
  46.                                 {# 2️⃣ If all images are null → show placeholder #}
  47.                                 {% if images is empty %}
  48.                                     {% set images = ['images/no-image.png'] %}
  49.                                 {% endif %}
  50.                                 {# MAIN SLIDER #}
  51.                                 <div class="swiper product-main-slider">
  52.                                     <div class="swiper-wrapper">
  53.                                         {% for img in images %}
  54.                                             <div class="swiper-slide">
  55.                                                 <img src="{{ asset(img) }}" alt="product image">
  56.                                             </div>
  57.                                         {% endfor %}
  58.                                     </div>
  59.                                 </div>
  60.                                 {# THUMB SLIDER #}
  61.                                 <div class="swiper product-thumb-slider">
  62.                                     <div class="swiper-wrapper">
  63.                                         {% for img in images %}
  64.                                             <div class="swiper-slide">
  65.                                                 <img src="{{ asset(img) }}" alt="product thumbnail">
  66.                                             </div>
  67.                                         {% endfor %}
  68.                                     </div>
  69.                                 </div>
  70.                             </div>
  71.                             <div class="wrapper-description">
  72.                                 <h2>
  73.                                     {{ product.title }}
  74.                                 </h2>
  75.                                 <ul>
  76.                                     <li>
  77.                                         <span>{{ 'Category'|trans }}:</span>
  78.                                         <strong>{{ product.category.title }}</strong>
  79.                                     </li>
  80.                                     <li>
  81.                                         <span>{{ 'Collection'|trans }}:</span>
  82.                                         <strong>{{ product.collection.title }}</strong>
  83.                                     </li>
  84.                                     <li>
  85.                                         <span>{{ 'Weight'|trans }}:</span>
  86.                                         <strong>{{ product.weight }}</strong>
  87.                                     </li>
  88.                                     <li>
  89.                                         <span>{{ 'Material'|trans }}:</span>
  90.                                         <strong>{{ product.type }}</strong>
  91.                                     </li>
  92.                                     {% if product.stone %}
  93.                                     <li>
  94.                                         <span>{{ 'Stones'|trans }}:</span>
  95.                                         <strong> {{ product.stone }}</strong>
  96.                                     </li>
  97.                                     {% endif %}
  98.                                 </ul>
  99.                                 <div class="wrapper-bottom">
  100.                                     <h4>
  101.                                         {{ product.price|number_format ~ 'դրամ'|trans }}
  102.                                     </h4>
  103.                                     <button class="main-shop-btn">
  104.                                         {{ 'ADD TO CARD'|trans }}
  105.                                         <svg width="20" height="17" viewBox="0 0 20 17" fill="none"
  106.                                              xmlns="http://www.w3.org/2000/svg">
  107.                                             <path d="M15.9987 11.8333H5.16536L3.08203 3.5H18.082L15.9987 11.8333Z"
  108.                                                   fill="#0F0F0F"></path>
  109.                                             <path d="M1 1H2.45833L3.08333 3.5M3.08333 3.5L5.16667 11.8333H16L18.0833 3.5H3.08333Z"
  110.                                                   stroke="#0F0F0F" stroke-width="2" stroke-linecap="round"
  111.                                                   stroke-linejoin="round"></path>
  112.                                             <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"
  113.                                                   stroke="#0F0F0F" stroke-width="2" stroke-linecap="round"
  114.                                                   stroke-linejoin="round"></path>
  115.                                             <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"
  116.                                                   stroke="#0F0F0F" stroke-width="2" stroke-linecap="round"
  117.                                                   stroke-linejoin="round"></path>
  118.                                         </svg>
  119.                                     </button>
  120.                                 </div>
  121.                             </div>
  122.                         </div>
  123.                         {% if product.productDescription %}
  124.                         <div class="wrapper-additional-information">
  125.                             <h3>
  126.                                 {{ 'Description'|trans }}
  127.                             </h3>
  128.                             {{ product.productDescription }}
  129.                         </div>
  130.                         {% endif %}
  131.                         <div class="wrapper-additional-information">
  132.                             <h3>
  133.                                 {{ delivery.title }}
  134.                             </h3>
  135.                            {{ delivery.description|raw }}
  136.                             <div class="payment-methods">
  137.                                 <ul>
  138.                                     <li>
  139.                                         <img src="{{ asset('images/visa.png') }}" alt="Visa">
  140.                                     </li>
  141.                                     <li>
  142.                                         <img src="{{ asset('images/mastercard.png') }}" alt="MasterCard">
  143.                                     </li>
  144.                                     <li>
  145.                                         <img src="{{ asset('images/arca.png') }}" alt="ArCa">
  146.                                     </li>
  147.                                 </ul>
  148.                             </div>
  149.                         </div>
  150.                     </div>
  151.                     <div class="wrapper-recent-products">
  152.                         <h5>
  153.                             {{ 'YOU MIGHT ALSO LIKE'|trans }}
  154.                         </h5>
  155.                         <div class="swiper mySwiper">
  156.                             <div class="swiper-wrapper">
  157.                                 {% for item in products %}
  158.                                     <div class="swiper-slide">
  159.                                         <a href="{{ path('page_heritage_product_view',{'id':item.id}) }}"
  160.                                            class="wrapper-item">
  161.                                             <div class="wrapper-image">
  162.                                                 <img src="{{ item.image }}" alt="">
  163.                                             </div>
  164.                                             <span class="wrapper-description">
  165.                                             <strong>
  166.                                                 {{ item.title }}
  167.                                             </strong>
  168.                                             <span>
  169.                                                {{ item.price|number_format ~ 'դրամ'|trans }}
  170.                                             </span>
  171.                                         </span>
  172.                                         </a>
  173.                                     </div>
  174.                                 {% endfor %}
  175.                             </div>
  176.                         </div>
  177.                     </div>
  178.                 </div>
  179.             </div>
  180.         </div>
  181.     </section>
  182. {% endblock %}