themes/BootstrapChildTheme/SyliusShopBundle/views/Product/index.html.twig line 38

Open in your IDE?
  1. {% extends '@SyliusShop/layout.html.twig' %}
  2. {% set taxon = get_taxon_by_slug(app.request.attributes.get('slug'), sylius.localeCode) %}
  3. {% set menuTaxons = get_menu_taxon_by_slug(taxon, sylius.localeCode) %}
  4. {% block stylesheets %}
  5.     {{ parent() }}
  6.     {{ encore_entry_link_tags('shop-category-view', null, 'bootstrapTheme') }}
  7. {% endblock %}
  8. {% block javascripts %}
  9.     {{ parent() }}
  10.     {{ encore_entry_script_tags('shop-category-view', null, 'bootstrapTheme') }}
  11. {% endblock %}
  12. {% block title %}
  13.     {{ sylius_template_event('dedi_sylius_seo_plugin.title', { resource: taxon ?? product ?? sylius.channel, title: taxon }) }}
  14. {% endblock %}
  15. {% block breadcrumb %}
  16.     {% include '@SyliusShop/Taxon/_breadcrumb.html.twig' %}
  17. {% endblock %}
  18. {% block content %}
  19.     {#{% include '@SyliusShop/Product/Index/_header.html.twig' %}#}
  20.     {% include '@SyliusShop/_tracking/data_layer.html.twig' %}
  21.     {% if taxon.isRoot() and taxon.code  %}
  22.         <div class="catalog catalog-all">
  23.             {% include '@SyliusShop/Product/Index/_all_categories.html.twig' with { 'taxon': taxon } %}
  24.         </div>
  25.     {% elseif taxon.parent and not taxon.parent.isRoot() %}
  26.         <div class="row taxons">
  27.             <div class="d-none d-md-block col-md-4 col-lg-3 col-xl-3 col-xxl-2">
  28.                 {% include '@SyliusShop/Product/Index/_sidebar.html.twig' %}
  29.             </div>
  30.             <div class="col-12 col-md-8 col-lg-9 col-xxl-10">
  31.                 <h1 class="taxon-title">{{ taxon.name }}</h1>
  32.                 {% if taxon.description %}
  33.                     <div class="taxon-description">{{ taxon.description }}</div>
  34.                 {% endif %}
  35.                 {% set taxonChildren = taxon.children  %}
  36.                 {% if taxonChildren|length %}
  37.                     <h4 class="title d-md-none">{{ 'app.ui.taxon.subtaxons' | trans }}</h4>
  38.                     <div class="subtaxons row row-cols-2 g-3 mb-5 row-cols-sm-3 d-md-none">
  39.                         {% for child in taxonChildren %}
  40.                             {% if child.enabled %}
  41.                                 <div class="subtaxons-item col">
  42.                                     <a class="subtaxons-link d-flex align-items-center h-100 p-3 border rounded link-no-decoration cfs-7 lh-1 fw-normal" href="{{ path('sylius_shop_product_index', {'slug': child.redirect ?: child.slug, '_locale': child.translation.locale}) }}">{{ child.name }}</a>
  43.                                 </div>
  44.                             {% endif %}
  45.                         {% endfor %}
  46.                     </div>
  47.                 {% endif %}
  48.                 {% include '@SyliusShop/Product/Index/_main.html.twig' with { 'taxon': taxon } %}
  49.             </div>
  50.         </div>
  51.     {% elseif taxon.parent and taxon.parent.isRoot() %}
  52.         <div class="catalog catalog-taxon">
  53.             {#{{ dump(taxon) }}#}
  54.             <div class="taxon mb-4">
  55.                 <h1 class="custom-display-4 text-center">{{ taxon.name }}</h1>
  56.                 {% if taxon.description is not empty %}
  57.                     <div class="description">
  58.                         {{ taxon.description|raw }}
  59.                     </div>
  60.                 {% endif %}
  61.             </div>
  62.             {% for taxonItem in menuTaxons %}
  63.                 {#{{ dump(taxonItem) }}#}
  64.                 {% set taxonItemImage = taxonItem.imagesByType('catalog') is not empty %}
  65.                 <div class="taxon-item row py-4{% if not loop.first %} mt-6{% endif%}{% if loop.index is odd %} bg-light{% endif %}">
  66.                     {% if taxonItem.imagesByType('catalog') is not empty %}
  67.                         <div class="taxon-item-img-wrap d-none d-lg-block col-lg-6 col-xxxxl-5 col-xxxxxl-4 ps-lg-4">
  68.                             <a href="{{ path('sylius_shop_product_index', {'slug': taxonItem.redirect ?: taxonItem.slug, '_locale': taxonItem.translation.locale}) }}">
  69.                                 {#<picture>#}
  70.                                 {#    <source srcset="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_desktop') }}" media="(min-width: 992px)">#}
  71.                                 {#    <source srcset="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_mobile') }}">#}
  72.                                 {#    <img class="taxon-item-img" src="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_original') }}" alt="{{ taxonItem.name }}">#}
  73.                                 {#</picture>#}
  74.                                 <img class="taxon-item-img lazy" src="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_desktop_small') }}" data-src="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_desktop') }}" alt="{{ taxonItem.name }}">
  75.                             </a>
  76.                         </div>
  77.                     {% endif %}
  78.                     <div class="taxon-item-text d-flex flex-column justify-content-center col-lg-6 col-xxxxl-7 col-xxxxxl-8{% if loop.index is odd %} order-lg-first{% endif %}">
  79.                         <div class="taxon-item-text-content{# p-4#}">
  80.                             <h2 class="taxon-item-title custom-display-7 mb-0 text-center d-flex flex-column justify-content-center text-lg-start"
  81.                                 onclick="window.location.href='{{ path('sylius_shop_product_index', {'slug': taxonItem.redirect ?: taxonItem.slug, '_locale': taxonItem.translation.locale}) }}'"
  82.                                 {% if taxonItemImage %}style="background-image: url({{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_mobile') }});"{% endif %}
  83.                             >
  84.                                 <span class="taxon-item-title-text">{{ taxonItem.name }}</span>
  85.                             </h2>
  86.                             {% if taxonItem.description is not empty %}
  87.                                 <div class="description fw-normal mt-3">{{ taxonItem.description|raw }}</div>
  88.                             {% endif %}
  89.                             {{ render(url('app_shop_products_by_label_code_and_taxon_slug', {
  90.                                 'labelCode': 'top',
  91.                                 'taxonSlug': taxonItem.redirect ?: taxonItem.slug,
  92.                                 'count': 20,
  93.                                 'template': '@SyliusShop/Product/Box/_top_products_slider.html.twig',
  94.                                 'taxonName': taxonItem.name,
  95.                                 'taxonCode': taxonItem.code
  96.                             })) }}
  97.                         </div>
  98.                     </div>
  99.                     {#<div class="link">#}
  100.                     {#    <a href="{{ path('sylius_shop_product_index', {'slug': taxonItem.slug, '_locale': taxonItem.translation.locale})  }}">{{ 'app.ui.taxon.view' | trans }}</a>#}
  101.                     {#</div>#}
  102.                     {#                    <div class="col-12 mt-4 text-end">#}
  103.                     {#                        <a class="btn btn-lg btn-outline-primary d-inline-flex align-items-center" href="{{ path('sylius_shop_product_index', {'slug': taxonItem.slug, '_locale': taxonItem.translation.locale}) }}">{{ 'app.ui.taxon.view'|trans }}<svg class="icon icon-xl bi-arrow-right-short  ms-2" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path fill-rule="evenodd" d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z"/></svg></a>#}
  104.                     {#                    </div>#}
  105.                 </div>
  106.             {% endfor %}
  107.         </div>
  108.     {% endif %}
  109. {% endblock %}