themes/BootstrapChildTheme/SyliusShopBundle/views/Product/show.html.twig line 1

Open in your IDE?
  1. {% extends '@SyliusShop/layout.html.twig' %}
  2. {% block title %}{{ product.name }} | {{ parent() }}{% endblock %}
  3. {% set productImages = (product.images | length) %}
  4. {% block metatags %}
  5.     {% if product.metaDescription is not null %}
  6.         <meta name="description" content="{{ product.metaDescription }}">
  7.     {% endif %}
  8. {% endblock %}
  9. {% block stylesheets %}
  10.     {{ parent() }}
  11.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
  12. {% endblock %}
  13. {% block content %}
  14. {% include '@SyliusShop/Product/Show/_breadcrumb.html.twig' %}
  15. <div class="ui hidden divider"></div>
  16. <div class="ui two column stackable grid custom-product-detail-page-trigger-class">
  17.     <div class="column">
  18.         {{ sylius_template_event('sylius.shop.product.show.left_sidebar', _context) }}
  19.     </div>
  20.     <div class="column">
  21.         {{ sylius_template_event('sylius.shop.product.show.right_sidebar', _context) }}
  22.     </div>
  23. </div>
  24.  {% if product.mainTaxon is not null %}
  25.     {% set taxon = product.mainTaxon %}
  26.     {% if taxon.enabled %}
  27.         {% if taxon.slug == 'storyteller' %}
  28.             <div class="row step_guide mb-5 mt-5">
  29.                 <div class="col-6 col-md-3 text-center">
  30.                     {# <img src="{{ asset('assets/shop/img/step_1.png') }}" class="step_guide_image img-fluid" alt="{{'sylius.pages.content.childrenLitrature'|trans }}" /> #}
  31.                      <picture>
  32.                         <source srcset="{{ asset('assets/shop/img/step_1.webp') }}" type="image/webp">
  33.                         <source srcset="{{ asset('assets/shop/img/step_1.png') }}" type="image/png">
  34.                         <img width="200px" height="200px" style="width:100% !important; height: auto !important;" src="{{ asset('assets/shop/img/step_1.png') }}" class="mb-2 step_guide_image img-fluid" alt="{{'sylius.pages.content.childrenLitrature'|trans }}" />
  35.                     </picture>
  36.                     <div class="text-center mt-3 mb-3 font-weight-bold">{{'sylius.pages.content.childrenLitrature'|trans }}</div>
  37.                 </div>
  38.                 <div class="col-6 col-md-3 text-center mb-3">
  39.                  <picture>
  40.                         <source srcset="{{ asset('assets/shop/img/step_2.webp') }}" type="image/webp">
  41.                         <source srcset="{{ asset('assets/shop/img/step_2.png') }}" type="image/png">
  42.                     <img width="200px" height="200px" style="width:100% !important; height: auto !important;" src="{{ asset('assets/shop/img/step_2.png') }}" class="step_guide_image img-fluid" alt="{{'sylius.pages.content.quizToLearn'|trans }}" />
  43.                  </picture>
  44.                     <div class="text-center mt-3 mb-3 font-weight-bold">{{'sylius.pages.content.quizToLearn'|trans }}</div>
  45.                 </div>
  46.                 <div class="col-6 col-md-3 text-center mb-3">
  47.                 <picture>
  48.                         <source srcset="{{ asset('assets/shop/img/step_5.webp') }}" type="image/webp">
  49.                         <source srcset="{{ asset('assets/shop/img/step_5.png') }}" type="image/png">
  50.                     <img width="200px" height="200px" style="width:100% !important; height: auto !important;" src="{{ asset('assets/shop/img/step_5.png') }}" class="step_guide_image img-fluid" alt="{{'sylius.pages.content.atonomyOfTheChild'|trans }}" />
  51.                 </picture>
  52.                     <div class="text-center mt-3 mb-3 font-weight-bold">{{'sylius.pages.content.atonomyOfTheChild'|trans }}​</div>
  53.                 </div>
  54.                 <div class="col-6 col-md-3 text-center mb-3">
  55.                   <picture>
  56.                         <source srcset="{{ asset('assets/shop/img/step_4.webp') }}" type="image/webp">
  57.                         <source srcset="{{ asset('assets/shop/img/step_4.png') }}" type="image/png">
  58.                         <img width="200px" height="200px" style="width:100% !important; height: auto !important;" src="{{ asset('assets/shop/img/step_4.png') }}" class="step_guide_image img-fluid" alt="{{'sylius.pages.content.herosWithYou'|trans }}"/>
  59.                     </picture>
  60.                     <div class="text-center mt-3 mb-3 font-weight-bold">{{'sylius.pages.content.herosWithYou'|trans }}</div>
  61.                 </div>
  62.             </div>
  63.             <h4 class="ui horizontal section divider header">{{ 'sylius.pages.content.details'|trans }}</h4>
  64.             <div class="row product_details_guide mb-5 mt-5">
  65.                 <div class="col-sm-6">
  66.                     <ul>
  67.                         <li>{{'sylius.pages.content.storyTeller.content.textOne'|trans }}</li>
  68.                         <li>{{'sylius.pages.content.storyTeller.content.textTwo'|trans }}</li>
  69.                         <li>{{'sylius.pages.content.storyTeller.content.textThree'|trans }}</li>
  70.                         <li>{{'sylius.pages.content.storyTeller.content.textFour'|trans }}</li>
  71.                         <li>{{'sylius.pages.content.storyTeller.content.textFive'|trans }}</li>
  72.                     </ul>
  73.                 </div>
  74.                 <div class="col-sm-6">
  75.                     <ul>
  76.                         <li>{{'sylius.pages.content.storyTeller.content.textSix'|trans }}</li>
  77.                         <li>{{'sylius.pages.content.storyTeller.content.textSeven'|trans }}</li>
  78.                         <li>{{'sylius.pages.content.storyTeller.content.textEight'|trans }}</li>
  79.                         <li>{{'sylius.pages.content.storyTeller.content.textNine'|trans }}</li>
  80.                         <li>{{'sylius.pages.content.storyTeller.content.textTen'|trans }}</li>
  81.                     </ul>
  82.                 </div>
  83.             </div>
  84.         {% endif %}
  85.         {% if taxon.slug == 'catalogue/per-pack-type/story' %}
  86.             {% if product.getPackSamples|length > 0 %}
  87.                 <h4 class="ui horizontal section divider header">{{'sylius.pages.content.packageContent'|trans }}</h4>
  88.                 <div class="row mb-5 mt-5">
  89.                     {% for sampleAttribute in product.getPackSamples %}
  90.                         <div class="col-sm-6 p-2">
  91.                             {# <picture>
  92.                             {# <source srcset="{{ '/media/packSampleThumbnail/' ~ path | imagine_filter('my_packSampleThumbnail_webp') }}" type="image/webp"> }
  93.                                 <source srcset="{{  sampleAttribute.image | imagine_filter('my_pack_sample_thumbnail_webp') }}" type="image/webp">
  94.                                 <source srcset="{{ asset('/media/packSampleThumbnail/' ~ sampleAttribute.image) }}" type="image/jpeg">
  95.                                 <img src="{{ asset('/media/packSampleThumbnail/' ~ sampleAttribute.image) }}" alt="{{ product.name }}" class="step_guide_image_two img-fluid">
  96.                             </picture> #}
  97.                             {# <img width="200px" height="200px" style="width:100% !important; height: auto !important;" src="/media/packSampleThumbnail/{{sampleAttribute.image}}" class="step_guide_image_two img-fluid" alt="{{sampleAttribute.title}}" /> #}
  98.                             <img src="/media/packSampleThumbnail/{{sampleAttribute.image}}" class="step_guide_image_two img-fluid" alt="{{sampleAttribute.title}}" />
  99.                             <div class="sidebar_text">
  100.                                 <div class="title">{{sampleAttribute.title}}</div>
  101.                                 <div class="description">{{sampleAttribute.description}}
  102.                                 <div class="audio_player"><audio controls><source src=" {{sampleAttribute.awsLink}}"/></audio></div>
  103.                             </div>
  104.                         </div>
  105.                         </div>
  106.                     {% endfor %}
  107.                 </div>
  108.             {% endif %}
  109.         {% endif %}
  110.     {% endif %}
  111.  {% endif %}
  112. {{ sylius_template_event('sylius.shop.product.show.content', _context) }}
  113. {% endblock %}
  114. {% block javascripts %}
  115. {{ parent() }}
  116. <script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
  117. <script type="text/javascript">
  118.     lightbox.option({
  119.         'albumLabel': '{{ 'sylius.lightbox.image_album_label'|trans|escape('js') }}'
  120.     });
  121.     {# {% if app.environment == "prod" %} #}
  122.     {% if app.environment == "prod" %}
  123.     var productId = {{product.id}};
  124.     {# let price = document.getElementById('product-price').innerHTML; #}
  125.     {% set productMainTaxon = product.mainTaxon %}
  126.     var productMainTaxonId = {{ productMainTaxon.id }};
  127.     var productMainTaxonName = '{{ productMainTaxon.name }}';
  128.     {% set pVariant = product|sylius_resolve_variant %}
  129.      let newPrice = price.replace(/&nbsp;/g,'');
  130.      newPrice = newPrice.replaceAll(' ','');
  131.      newPrice = newPrice.replace(/(\r\n|\n|\r)/gm, "");
  132.     let finalGTMData = {"customPageIdentifier": "productDetailPage", "productIdp":productId, "mainTaxonId":productMainTaxonId, "mainTaxonName":productMainTaxonName, "productPrice":newPrice};
  133.     {# dataLayer.push(); #}
  134.      {# dataLayer.push(finalGTMData); #}
  135.      {# {% if app.environment == "prod" %} #}
  136.         window.dataLayer = window.dataLayer || [];
  137.         dataLayer.push(finalGTMData);
  138.     {% endif %}
  139.     $(document).ready(function(){
  140.         {% if productImages > 1 %}
  141.             $(".owl-carousel.images").owlCarousel({
  142.                 items: {{ productImages > 3 ? 3 : (productImages == 3 ? 2 : productImages) }},
  143.                 loop: true,
  144.                 margin: 10,
  145.                 nav: 3,
  146.                 dots: false,
  147.             });
  148.         {% endif %}
  149.         var reviewOwl = $(".owl-carousel.reviews");
  150.         reviewOwl.on('initialized.owl.carousel', function(event) {
  151.             updateReviews();
  152.         })
  153.         reviewOwl.owlCarousel({
  154.             items: 2,
  155.             loop: true,
  156.             nav: true,
  157.             dots: true,
  158.             center: true,
  159.             responsive:{
  160.                 900:{
  161.                     items:3
  162.                 }
  163.             }
  164.     });
  165.         $(window).on('resize', function() {
  166.             updateReviews();
  167.         });
  168.     });
  169.     function changeSize(el){
  170.         var resizeText;
  171.         resizeText = function() {
  172.             return (parseInt($(el).css('font-size').slice(0, -2)) - 1) + 'px';
  173.         };
  174.         $(el).css('font-size', resizeText());
  175.         if (checkOverflow(el)) {
  176.             changeSize(el);
  177.         }
  178.     }
  179.     function checkOverflow(el)
  180.     {
  181.         var curOverflow = el.style.overflow;
  182.         if ( !curOverflow || curOverflow === "visible" )
  183.             el.style.overflow = "hidden";
  184.         var isOverflowing = el.clientWidth < el.scrollWidth
  185.             || el.clientHeight < el.scrollHeight;
  186.         el.style.overflow = curOverflow;
  187.         return isOverflowing;
  188.     }
  189.     function updateReviews() {
  190.         $('p.comment').each(function() {
  191.             $(this).css('font-size', '30px');
  192.             changeSize($(this).get(0));
  193.         })
  194.     }
  195. </script>
  196. {#
  197. <script src="https://partner.histoiresmax.com/ct/pt660025712.js?page=product&consent_ads={{1_OR_0
  198. }}&idcat={{CATEGORY_ID}}&wordingcat={{CATEGORY_LABEL}}&idp={{PRODUCT_ID}}&prix={{PRODUCT_
  199. PRICE}}&newcustomer={{1_OR_0}}" async="async" ></script> #}
  200. {% endblock %}