vendor/shopware/storefront/Resources/views/storefront/element/cms-element-cross-selling.html.twig line 1

Open in your IDE?
  1. {% block cms_element_cross_selling_tabs_inner %}
  2.     {% if not sliderConfig %}
  3.         {% set sliderConfig = element.fieldConfig.elements %}
  4.     {% endif %}
  5.     {% if element.data.crossSellings.elements is defined and element.data.crossSellings.elements|filter(item => item.total > 0)|length > 0 %}
  6.         <div class="product-detail-cross-selling">
  7.             <div class="card card-tabs" data-cross-selling="true">
  8.                 {% block cms_element_cross_selling_tabs_navigation %}
  9.                     <div class="card-header product-detail-tab-navigation product-cross-selling-tab-navigation">
  10.                         {% block cms_element_cross_selling_tabs_navigation_container %}
  11.                             <ul class="nav nav-tabs product-detail-tab-navigation-list"
  12.                                 id="product-detail-cross-selling-tabs"
  13.                                 role="tablist">
  14.                                 {% for item in element.data.crossSellings.elements|filter(item => item.total > 0 and item.crossSelling.active == true) %}
  15.                                     {% set crossSelling = item.crossSelling %}
  16.                                     {% set products = item.products %}
  17.                                     {% set id = crossSelling.id %}
  18.                                         <li class="nav-item">
  19.                                             <a class="nav-link product-detail-tab-navigation-link{% if loop.first %} active{% endif %}"
  20.                                                id="cross-selling-tab-{{ id }}"
  21.                                                {{ dataBsToggleAttr }}="tab"
  22.                                                href="#cross-selling-tab-{{ id }}-pane"
  23.                                                role="tab"
  24.                                                aria-controls="cross-selling-tab-{{ id }}-pane"
  25.                                                aria-selected="true">
  26.                                                 {{ crossSelling.translated.name }}
  27.                                                 <span class="product-detail-tab-navigation-icon">
  28.                                                     {% sw_icon 'arrow-medium-right' style {'pack':'solid'} %}
  29.                                                 </span>
  30.                                             </a>
  31.                                         </li>
  32.                                 {% endfor %}
  33.                             </ul>
  34.                         {% endblock %}
  35.                     </div>
  36.                 {% endblock %}
  37.                 {% block cms_element_cross_selling_tabs_content %}
  38.                     <div class="product-detail-tabs-content card-body">
  39.                         {% block cms_element_cross_selling_tabs_content_container %}
  40.                             <div class="tab-content">
  41.                                 {% for item in element.data.crossSellings.elements|filter(item => item.total > 0 and item.crossSelling.active == true) %}
  42.                                     {% set crossSelling = item.crossSelling %}
  43.                                     {% set products = item.products %}
  44.                                     {% set id = crossSelling.id %}
  45.                                         <div class="tab-pane fade show{% if loop.first %} active{% endif %}"
  46.                                              id="cross-selling-tab-{{ id }}-pane"
  47.                                              role="tabpanel"
  48.                                              aria-labelledby="cross-selling-tab-{{ id }}">
  49.                                             {% set config = {
  50.                                                 'title': {
  51.                                                     'value': crossSelling.name ?: crossSelling.translated.name
  52.                                                 },
  53.                                                 'border': {
  54.                                                     'value': false
  55.                                                 },
  56.                                                 'rotate': {
  57.                                                     'value': false
  58.                                                 },
  59.                                                 'products': {
  60.                                                     'value': products
  61.                                                 },
  62.                                                 'boxLayout': {
  63.                                                     'value': sliderConfig.boxLayout.value
  64.                                                 },
  65.                                                 'elMinWidth': {
  66.                                                     'value': sliderConfig.elMinWidth.value
  67.                                                 },
  68.                                                 'navigation': {
  69.                                                     'value': true
  70.                                                 },
  71.                                                 'displayMode': {
  72.                                                     'value': sliderConfig.displayMode.value
  73.                                                 },
  74.                                                 'verticalAlign': {
  75.                                                     'value': center
  76.                                                 }
  77.                                             } %}
  78.                                             {% block cms_element_cross_selling_tabs_content_container_slider %}
  79.                                                 {% sw_include "@Storefront/storefront/element/cms-element-product-slider.html.twig" with {
  80.                                                     sliderConfig: config,
  81.                                                     element: {
  82.                                                         'data': {
  83.                                                             'products': products
  84.                                                         },
  85.                                                         type: 'product-slider'
  86.                                                     }
  87.                                                 } %}
  88.                                             {% endblock %}
  89.                                         </div>
  90.                                 {% endfor %}
  91.                             </div>
  92.                         {% endblock %}
  93.                     </div>
  94.                 {% endblock %}
  95.             </div>
  96.         </div>
  97.     {% endif %}
  98. {% endblock %}