templates/product/show.html.twig line 1

Open in your IDE?
  1. {% extends 'layout/default.html.twig' %}
  2. {% block headScript %}
  3. <!--Should be included only in product templates-->
  4. <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  5. {% endblock %}
  6. {% block metaTags %}
  7.         <title>{{ product is defined ? product.metaTitle }}</title>
  8.         <meta name="description" content="{{ product is defined ? product.metaDescription }}"></meta>
  9.         <meta name="keywords" content="{{ product is defined ? product.metaKeywords }}"></meta>
  10.         <meta property="og:url"           content="{{ app.request.uri }}" />
  11.         <meta property="og:type"          content="website" />
  12.         <meta property="og:title"         content="{{ product is defined ? product.ogTitle }}" />
  13.         <meta property="og:description"   content="{{ product is defined ? product.ogDescription }}" />
  14.         <meta property="og:image"         content="{{ product is defined and product.ogImage ? product.ogImage }}" />
  15.         <meta name="twitter:card" content="summary" />
  16.         <meta name="twitter:site" content="{{ app.request.uri }}" />
  17.         <meta name="twitter:title" content="{{ product is defined ? product.ogTitle }}" />
  18.         <meta name="twitter:description" content="{{ product is defined ? product.ogDescription }}" />
  19.         <meta name="twitter:image" content="{{ product is defined and product.ogImage ? absolute_url(product.ogImage) }}" />
  20. {% endblock %}
  21. {% block contentBlock %}
  22. {% set anyMaze = 'any-maze' in product.name | lower %}
  23.     <main class="productPage mt-5 mt-lg-5 mt-md-5">
  24.         {% include 'Components/info-message.html.twig' with {message: 'alert.no.quantity' | trans, show: false, color: 'text-ice', icon: 'info.svg' } %}
  25.         <div class="container mt-3 mt-lg-3 mt-md-3 mb-5 mb-lg-5 mb-md-5">
  26.             <div class="row">
  27.                 <!-- * Desktop version-->
  28.                 <div class="product-breadcrumb-heading d-none d-md-block col-lg-12 border-2 border-bottom border-indigo custom-bradcrumb-padding-product" style="margin-top: -4px;">
  29.                     <div class="d-flex align-items-center flex-wrap">
  30.                         <h2 class="font-weight-bold mb-0" style="max-width: 60%;">{{ product.name }}</h2>
  31.                         <div class="d-flex ml-auto breadcrumb-links">
  32.                             <small class="font-weight-bold text-uppercase mb-0">
  33.                                 <div class="d-flex align-items-center flex-wrap">
  34.                                     <a href="{{ breadcrumbs.parentCategory is defined ? breadcrumbs.parentCategory.href }}" class="font-weight-bold">
  35.                                         <span class="">{% if breadcrumbs.parentCategory is defined %}{{ breadcrumbs.parentCategory.name }}{% endif %}</span>
  36.                                     </a>
  37.                                     <svg class="mx-2 mx-lg-2 mx-md-2" width="11" height="16" viewBox="0 0 11 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  38.                                         <line y1="-1" x2="11.7434" y2="-1" transform="matrix(-0.733639 0.679539 0.733639 0.679539 10.6155 8.02002)" stroke="#405CCA" stroke-width="2"/>
  39.                                         <line y1="-1" x2="11.7434" y2="-1" transform="matrix(-0.733639 -0.679539 0.733639 -0.679539 10.6155 7.98004)" stroke="#405CCA" stroke-width="2"/>
  40.                                     </svg>
  41.                                     <a href="{{ breadcrumbs.category.href }}" class="font-weight-bold">
  42.                                         <span class="text-navyBlue">{{ breadcrumbs.category.name }}</span>
  43.                                     </a>
  44.                                 </div>
  45.                             </small>
  46.                         </div>
  47.                     </div>
  48.                 </div>
  49.                 <!-- * Mobile version-->
  50.                 <div class="d-block d-md-none col-lg-12 pb-3 pb-lg-3 pb-md-3">
  51.                     <div class="d-flex align-items-center flex-wrap">
  52.                         <div class="d-flex breadcrumb-links">
  53.                             <small class="font-weight-bold text-uppercase">
  54.                                 <div class="d-flex align-items-center flex-wrap">
  55.                                     <a href="{{ breadcrumbs.parentCategory is defined ? breadcrumbs.parentCategory.href }}" class="font-weight-bold">
  56.                                         <span class="">{% if breadcrumbs.parentCategory is defined %}{{ breadcrumbs.parentCategory.name }}{% endif %}</span>
  57.                                     </a>
  58.                                     <svg class="mx-2 mx-lg-2 mx-md-2" width="11" height="16" viewBox="0 0 11 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  59.                                         <line y1="-1" x2="11.7434" y2="-1" transform="matrix(-0.733639 0.679539 0.733639 0.679539 10.6155 8.02002)" stroke="#405CCA" stroke-width="2"/>
  60.                                         <line y1="-1" x2="11.7434" y2="-1" transform="matrix(-0.733639 -0.679539 0.733639 -0.679539 10.6155 7.98004)" stroke="#405CCA" stroke-width="2"/>
  61.                                     </svg>
  62.                                     <a href="{{ breadcrumbs.category.href }}" class="font-weight-bold">
  63.                                         <span class="text-navyBlue">{{ breadcrumbs.category.name }}</span>
  64.                                     </a>
  65.                                 </div>
  66.                             </small>
  67.                         </div>
  68.                     </div>
  69.                 </div>
  70.             </div>
  71.             <!--*PRODUCT GALLERY AND DATA-->
  72.             <div class="row mt-4 mt-lg-4 mt-md-4">
  73.                 <div class="col-xl-5 offset-xl-1 col-lg-6">
  74.                     <div class="d-flex justify-content-md-center flex-sm-column flex-md-row main-gallery main-gallery-initial">
  75.                         <div class="d-none d-md-block product-images-scroll order-sm-2 order-md-1">
  76.                             <button class="product-images-scroll-btn product-images-scroll-btn--up d-none">
  77.                             </button>
  78.                             <div class="d-flex flex-sm-row flex-md-column product-images-scroll-inside product-images-scroll-inside--desktop">
  79.                                 {% for index, variantsImage in variants %}
  80.                                     {% if variantsImage.image != null %}
  81.                                         <div data-product-gallery-index="{{ loop.index }}"
  82.                                             data-product-sku="{{ variantsImage.sku }}"
  83.                                             href="{{ variantsImage.image != null ? variantsImage.image.getThumbnail('Stoelting_gallery_small') }}"
  84.                                             class="product-small-image mb-2 mb-lg-2 mb-md-2">
  85.                                             <img src="{{ variantsImage.image != null ? variantsImage.image.getThumbnail('Stoelting_gallery_small') }}"
  86.                                                 alt="Product small image" class="img-fluid">
  87.                                         </div>
  88.                                     {% endif %}
  89.                                 {% endfor %}
  90.                             </div>
  91.                             <button class="product-images-scroll-btn product-images-scroll-btn--down d-none">
  92.                             </button>
  93.                         </div>
  94.                         <!-- * Mobile -->
  95.                         <div class="product-images-scroll--mobile-wrapper d-block d-md-none order-sm-2 order-md-1 position-relative">
  96.                             <button class="product-images-scroll-btn product-images-scroll-btn--up d-none">
  97.                             </button>
  98.                             <div class="product-images-scroll product-images-scroll--mobile">
  99.                                 <div class="d-flex flex-sm-row flex-md-column product-images-scroll-inside product-images-scroll-inside--mobile">
  100.                                     {% for index, variantsImage in variants %}
  101.                                         {% if variantsImage.image != null %}
  102.                                             <div data-product-gallery-index="{{ loop.index }}"
  103.                                                 data-product-sku="{{ variantsImage.sku }}"
  104.                                                 href="{{ variantsImage.image != null ? variantsImage.image.getThumbnail('Stoelting_gallery_small') }}"
  105.                                                 class="product-small-image mb-2 mb-lg-2 mb-md-2">
  106.                                                 <img src="{{ variantsImage.image != null ? variantsImage.image.getThumbnail('Stoelting_gallery_small') }}"
  107.                                                 alt="Product small image" class="img-fluid">
  108.                                             </div>
  109.                                         {% endif %}
  110.                                     {% endfor %}
  111.                                 </div>
  112.                             </div>
  113.                             <button class="product-images-scroll-btn product-images-scroll-btn--down d-none">
  114.                             </button>
  115.                         </div>
  116.                         <div class="d-none hidden-gallery-images">
  117.                             {% for variantsImage in variants %}
  118.                                 {% if variantsImage.image != null %}
  119.                                     <div data-product-gallery-index="{{ loop.index }}" data-fancybox="gallery"  href="{{ variantsImage.image.getThumbnail('Stoelting_gallery_main') }}"  class="lazyload product-small-image mb-2 mb-lg-2 mb-md-2">
  120.                                         <img data-src="{{ variantsImage.image.getThumbnail('Stoelting_gallery_main') }}" alt="Product small image">
  121.                                     </div>
  122.                                 {% endif %}
  123.                             {% endfor %}
  124.                         </div>
  125.                         <div class="product-big-image order-sm-1 order-md-2">
  126.                             {% set break = false %}
  127.                             {% for variantsImage in variants %}
  128.                                 {% if not break %}
  129.                                     {% if variantsImage.image != null %}
  130.                                         <img class="product-big__image lazyload"
  131.                                              data-src="{{variantsImage.image != null ? variantsImage.image.getThumbnail('Stoelting_gallery_main') }}"
  132.                                              alt="Product big image"
  133.                                              data-fancybox-trigger="gallery"
  134.                                              data-fancybox-index="0"
  135.                                         >
  136.                                         <div class="set-center">
  137.                                             <div class="spinner-border d-none text-secondary" role="status">
  138.                                                 <span class="sr-only">Loading...</span>
  139.                                             </div>
  140.                                         </div>
  141.                                         <div class="product-big-image__sku">
  142.                                             <small>
  143.                                                 ITEM: {{ ' '  ~ variantsImage.sku != null ? variantsImage.sku }}
  144.                                             </small>
  145.                                         </div>
  146.                                         {% set break = true %}
  147.                                     {% endif %}
  148.                                 {%  endif %}
  149.                             {% endfor %}
  150.                         </div>
  151.                     </div>
  152.                     <h2 class="d-block d-md-none font-weight-bold mt-3 mt-lg-3 mt-md-3">{{ product.name }}</h2>
  153.                     <div class="mt-4 mt-lg-4 mt-md-4 text-deepGray"> {{ product.shortDescription | raw}} </div>
  154.                 </div>
  155.                 <div class="col-xl-5 col-lg-6">
  156.                     <div id="add-to-cart-app">
  157.                         <add-to-cart-wrapper v-slot:default="{productId, addToCartBulk,updateProductsList}">
  158.                             <table style="width: 100%" class="product-table text-deepGray">
  159.                                 <tbody>
  160.                                 <tr>
  161.                                     <th class="font-weight-bold">
  162.                                         {{ 'Item' | trans }}
  163.                                     </th>
  164.                                     <th class="font-weight-bold">
  165.                                         {{ 'Description' | trans }}
  166.                                     </th>
  167.                                     <th class="font-weight-bold">
  168.                                         {{ 'Price' | trans }}
  169.                                     </th>
  170.                                     <th class="font-weight-bold">
  171.                                         {{ 'QTY' | trans }}
  172.                                     </th>
  173.                                 </tr>
  174.                                 {% for variant in variants %}
  175.                                     <tr class="product-table-tr">
  176.                                         <td>
  177.                                             {{ variant.sku }}
  178.                                         </td>
  179.                                         <td>
  180.                                             {{ variant.name | raw }}
  181.                                         </td>
  182.                                         <td>
  183.                                             {% if variant.isPriceVisible %}
  184.                                                 {{ variant.price.net_price_str }}
  185.                                             {% else %}
  186.                                                 <a href="{{ path('login', {'division': division, '_target_path' : app.request.requestUri}) }}" class="login-price-link"
  187.                                                    data-gtm-event="login-price-click">Login</a>
  188.                                             {% endif %}
  189.                                         </td>
  190.                                         <td>
  191.                                             <input type="number" class="qunatity-input" value="0" min="0" max="100" style="width: 50px;" @change="updateProductsList($event, {{ variant.id }})">
  192.                                         </td>
  193.                                     </tr>
  194.                                 {% endfor %}
  195.                                 </tbody>
  196.                             </table>
  197.                             <div class="d-flex align-items-center mt-4 mt-lg-4 mt-md-4 add-to-cart-buttons-wrapper">
  198.                                     {% if not isEU %}
  199.                                         <a href="javascript:;"
  200.                                             :data-origin-product-id="productId"
  201.                                             :data-product-id="productId"
  202.                                             @click.prevent="addToCartBulk"
  203.                                             class="btn btn-primary btn-add-to-cart mr-3 mr-lg-3 mr-md-3 text-nowrap add-to-cart-click-element"
  204.                                             data-gtm-event="add-to-cart-click"
  205.                                             >
  206.                                             <div class="d-flex align-items-center text-nowrap">
  207.                                                 <img src="{{ asset('/static/images/icons/icon_cart.svg') }}" alt="Icon cart">
  208.                                                 {{ 'Add to cart' | trans }}
  209.                                             </div>
  210.                                         </a>
  211.                                     {% endif %}
  212.                                     <a href="javascript:;"
  213.                                         :data-origin-product-id="productId"
  214.                                         :data-product-id="productId"
  215.                                         @click.prevent="addToCartBulk"
  216.                                         class="btn btn-primary btn-add-to-cart mr-3 mr-lg-3 mr-md-3 text-nowrap add-to-quote-click-element"
  217.                                         data-gtm-event="add-to-quote-click"
  218.                                         >
  219.                                         <div class="d-flex align-items-center text-nowrap">
  220.                                             {{ 'Add to Quote' | trans }}
  221.                                         </div>
  222.                                     </a>
  223.                             </div>
  224.                         </add-to-cart-wrapper>
  225.                     </div>
  226.                 </div>
  227.             </div>
  228.             <!--Related PRODUCTS-->
  229.             <div class="my-4 my-lg-4 my-md-4 related-products">
  230.                 <div class="row border-top border-bottom border-2 border-lightGray {{ relatedProducts | length ? '' : 'd-none' }}">
  231.                     <div class="col-xl-10 offset-xl-1 py-4 py-lg-4 py-md-4">
  232.                         <div class="d-flex align-items-center">
  233.                             <h3 class="font-weight-light text-navyBlue mb-0">{{ 'Related Products + Recommendations' | trans }}</h3>
  234.                             <a class="collapse-close ml-auto" data-toggle="collapse" href="#collapseExample1" role="button" aria-expanded="false" aria-controls="collapseExample">
  235.                             </a>
  236.                         </div>
  237.                         <div class="row show" id="collapseExample1">
  238.                             <div class="col-lg-12">
  239.                                 <div class="slider-small--first mt-3 mt-lg-3 mt-md-3" data-slick='{"slidesToShow": 5}'>
  240.                                     {% for i,relatedProduct in relatedProducts %}
  241.                                         <a href="{{ relatedProduct.href }}" class="slider-small-item d-flex flex-column align-items-center text-center">
  242.                                             <img class="img-fluid" src="{{ relatedProduct.image != null ? relatedProduct.image.getThumbnail('Stoelting_small_slider') : pimcore_website_config('defaultProductImage').getThumbnail('Stoelting_small_slider') }}" />
  243.                                             <h5 class="font-weight-bold mt-3 mt-lg-3 mt-md-3 mb-0">{{ relatedProduct.name }}</h5>
  244.                                         </a>
  245.                                     {% endfor %}
  246.                                 </div>
  247.                             </div>
  248.                         </div>
  249.                     </div>
  250.                 </div>
  251.                 <div class="row border-bottom border-2 border-lightGray {{ purchasedTogether | length ? '' : 'd-none' }}">
  252.                     <div class="col-xl-10 offset-xl-1 py-4 py-lg-4 py-md-4">
  253.                         <div class="d-flex align-items-center">
  254.                             <h3 class="font-weight-light text-navyBlue mb-0">{{ 'Frequently Purchased Together' | trans }}</h3>
  255.                             <a class="collapse-close ml-auto collapsed" data-toggle="collapse" href="#collapseExample2" role="button" aria-expanded="false" aria-controls="collapseExample">
  256.                             </a>
  257.                         </div>
  258.                         <div class="row collapse" id="collapseExample2">
  259.                             <div class="col-lg-12">
  260.                                 <div class="slider-small mt-3 mt-lg-3 mt-md-3" data-slick='{"slidesToShow": 5}'>
  261.                                     {% for purchasedTogetherProduct in purchasedTogether %}
  262.                                         <a href="{{ purchasedTogetherProduct.href }}"  class="d-flex flex-column align-items-center text-center">
  263.                                             <img class="img-fluid" src="{{ purchasedTogetherProduct.image != null ? purchasedTogetherProduct.image.getThumbnail('Stoelting_small_slider') : pimcore_website_config('defaultProductImage').getThumbnail('Stoelting_small_slider') }}" />
  264.                                             <h5 class="font-weight-bold mt-3 mt-lg-3 mt-md-3 mb-0">{{ purchasedTogetherProduct.name  }}</h5>
  265.                                         </a>
  266.                                     {% endfor %}
  267.                                 </div>
  268.                             </div>
  269.                         </div>
  270.                     </div>
  271.                 </div>
  272.                 <div class="row border-bottom border-2 border-lightGray {{ replacementParts | length ? '' : 'd-none' }}">
  273.                     <div class="col-xl-10 offset-xl-1 py-4 py-lg-4 py-md-4">
  274.                         <div class="d-flex align-items-center">
  275.                             <h3 class="font-weight-light text-navyBlue mb-0">{{ 'Replacement Parts + Subcomponents' | trans }}</h3>
  276.                             <a class="collapse-close ml-auto collapsed" data-toggle="collapse" href="#collapseExample3" role="button" aria-expanded="false" aria-controls="collapseExample">
  277.                             </a>
  278.                         </div>
  279.                         <div class="row collapse" id="collapseExample3">
  280.                             <div class="col-lg-12">
  281.                                 <div class="slider-small mt-3 mt-lg-3 mt-md-3" data-slick='{"slidesToShow": 5}'>
  282.                                     {% for replacementPartsProduct in replacementParts %}
  283.                                         <a href="{{ replacementPartsProduct.href }}" class="d-flex flex-column align-items-center text-center">
  284.                                             <img class="img-fluid" src="{{ replacementPartsProduct.image != null ? replacementPartsProduct.image.getThumbnail('Stoelting_small_slider') : pimcore_website_config('defaultProductImage').getThumbnail('Stoelting_small_slider') }}" />
  285.                                             <h5 class="font-weight-bold mt-3 mt-lg-3 mt-md-3 mb-0">{{ replacementPartsProduct.name }}</h5>
  286.                                         </a>
  287.                                     {% endfor %}
  288.                                 </div>
  289.                             </div>
  290.                         </div>
  291.                     </div>
  292.                 </div>
  293.             </div>
  294.             <!--Product more details-->
  295.             <div class="row my-5 my-lg-5 my-md-5">
  296.                 <div class="col-lg-10 offset-xl-1" style="min-height: 300px;">
  297.                     <div class="d-flex">
  298.                         <div class="accordion" id="accordionProductMoreInfo" style="width: 100%;">
  299.                             {% set firstLoop = true %}
  300.                             {% for additionalContentButton in product.additionalContent %}
  301.                                 {% if additionalContentButton.type == 'AditionalContentText' %}
  302.                                     <button class="btn btn-lg btn-secondary btn-secondary--ghost mr-3 mr-lg-3 mr-md-3 mt-2 mt-lg-2 mt-md-2" type="button"
  303.                                             data-toggle="collapse" data-target="#collapse{{ loop.index }}"
  304.                                             aria-expanded="{{ loop.index == 1 ? 'true' : 'false'}}" aria-controls="collapse{{ loop.index }}"
  305.                                     >
  306.                                         {{ additionalContentButton.name }}
  307.                                     </button>
  308.                                     {% set firstLoop = false %}
  309.                                 {% endif %}
  310.                             {% endfor %}
  311.                             {% for additionalContent in product.additionalContent %}
  312.                                 {% if additionalContent.type == 'AditionalContentText' %}
  313.                                     <div id="collapse{{ loop.index }}" class="{{ loop.index != 1 ?  'collapse' : 'show' }} list-bullet overflow-x-auto" aria-labelledby="collapse{{ loop.index }}" data-parent="#accordionProductMoreInfo">
  314.                                         <div class="mt-4 mt-lg-4 mt-md-4 text-deepGray">
  315.                                             {{ additionalContent.content | raw }}
  316.                                         </div>
  317.                                     </div>
  318.                                 {% endif %}
  319.                             {% endfor %}
  320.                         </div>
  321.                     </div>
  322.                 </div>
  323.             </div>
  324.         </div>
  325.     </main>
  326. {% endblock %}
  327. {% block afterScripts %}
  328. <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
  329. <script type="text/javascript" src="https://cdn.rawgit.com/igorlino/elevatezoom-plus/1.1.6/src/jquery.ez-plus.js"></script>
  330. {% endblock %}