custom/plugins/ChespackTheme/src/Resources/views/storefront/page/product-detail/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/index.html.twig' %}
  2. {# Moved headline to the right #}
  3. {% block page_product_detail_headline %}{% endblock %}
  4. {# Adjusted cols #}
  5. {% block page_product_detail_media %}
  6.     <div class="col-lg-6 product-detail-media">
  7.         {% if page.product.media %}
  8.             {% sw_include '@Storefront/storefront/element/cms-element-image-gallery.html.twig' with {
  9.                 'mediaItems': mediaItems,
  10.                 'zoom': true,
  11.                 'zoomModal': true,
  12.                 'displayMode': 'contain',
  13.                 'gutter': 5,
  14.                 'minHeight': '610px',
  15.                 'navigationArrows': 'inside',
  16.                 'galleryPosition': 'underneath',
  17.                 'isProduct': true,
  18.                 'fallbackImageTitle': page.product.translated.name,
  19.                 'startIndexThumbnails': page.product.cover.position + 1,
  20.                 'startIndexSlider': page.product.cover.position + 1,
  21.                 'keepAspectRatioOnZoom': false
  22.             } %}
  23.         {% endif %}
  24.         {# Added wishlist button and modal #}
  25.         {% sw_include '@Storefront/storefront/page/product-detail/wishlist.html.twig' %}
  26.     </div>
  27. {% endblock %}
  28. {# Adjusted cols #}
  29. {% block page_product_detail_buy %}
  30.     <div class="col-lg-6 product-detail-buy">
  31.         {% block page_product_detail_headline_moved %}
  32.             <div class="row align-items-center product-detail-headline">
  33.                 {% sw_include '@Storefront/storefront/page/product-detail/headline.html.twig' %}
  34.             </div>
  35.         {% endblock %}
  36.         {% sw_include '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
  37.     </div>
  38. {% endblock %}
  39. {# Adjusting layout - moved reviews out of tabs, moved cross selling to the right side #}
  40. {% block page_product_detail_tabs %}
  41.     <div id="product-detail-tabs-wrapper" class="product-detail-tabs-wrapper">
  42.         <div class="row">
  43.             <div class="product-detail-tabs col-md-6">
  44.                 {% sw_include '@Storefront/storefront/page/product-detail/tabs.html.twig' %}
  45.             </div>
  46.             {# Related products #}
  47.             {% block page_product_detail_cross_selling_moved %}
  48.                 {% if page.crossSellings.elements is defined and page.crossSellings.elements|filter(item => item.total > 0)|length > 0 %}
  49.                     <div class="product-detail-related-products col-md-6">
  50.                         {% sw_include '@Storefront/storefront/page/product-detail/cross-selling/related-products.html.twig' with {
  51.                             crossSellings: page.crossSellings
  52.                         } %}
  53.                     </div>
  54.                 {% endif %}
  55.             {% endblock %}
  56.         </div>
  57.     </div>
  58.     {# Related resources #}
  59.     {% block page_product_detail_related_resources %}
  60.         {% set relatedResources = [] %}
  61.         {% for category in page.product.customFields.related_resource_categories  %}
  62.             {% set relatedResources = relatedResources|merge([{
  63.                 'category': 'Resource',
  64.                 'image': category.media,
  65.                 'name': category.description,
  66.                 'short_description': category.customFields.related_resource_button_text,
  67.                 'url': category.customFields.related_resource_link
  68.             }])
  69.             %}
  70.         {% endfor %}
  71.         {% if config('ChespackTheme.config.enableRelatedResourcesOnPdp') == true and relatedResources %}
  72.             <div class="product-detail-related-resources">
  73.                 <div class="product-detail-related-resources-content row no-gutters">
  74.                     <div class="col">
  75.                         <h3 class="text-center">{{ "chespackTheme.product.relatedResources"|trans|sw_sanitize }}</h3>
  76.                         {% block page_product_detail_related_resources_slider %}
  77.                             {% sw_include '@Storefront/storefront/page/product-detail/related-resources/related-resources.html.twig' %}
  78.                         {% endblock %}
  79.                     </div>
  80.                 </div>
  81.             </div>
  82.         {% endif %}
  83.     {% endblock %}
  84.     {# Reviews #}
  85.     {% block page_product_detail_reviews %}
  86.         {% if config('core.listing.showReview') %}
  87.             <div class="product-detail-section-reviews is--fullwidth">
  88.                 <div class="container">
  89.                     {% block page_product_detail_reviews_inner %}
  90.                         <div id="review-tab" class="product-detail-tabs-content">
  91.                             {% sw_include '@Storefront/storefront/page/product-detail/review/review.html.twig' with {'reviews': page.reviews} %}
  92.                         </div>
  93.                     {% endblock %}
  94.                 </div>
  95.             </div>
  96.         {% endif %}
  97.     {% endblock %}
  98. {% endblock %}
  99. {# Moved cross selling to the rightside of tabs #}
  100. {% block page_product_detail_cross_selling %}{% endblock %}