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

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.     {% if taxon.isRoot() %}
  21.         <div class="catalog catalog-all">
  22.             {% include '@SyliusShop/Product/Index/_all_categories.html.twig' with { 'taxon': taxon } %}
  23.         </div>
  24.     {% elseif taxon.parent and not taxon.parent.isRoot() %}
  25.         <div class="row taxons">
  26.             <div class="d-none d-md-block col-md-4 col-lg-3 col-xl-3 col-xxl-2">
  27.                 {% include '@SyliusShop/Product/Index/_sidebar.html.twig' %}
  28.             </div>
  29.             <div class="col-12 col-md-8 col-lg-9 col-xxl-10">
  30.                 <h1 class="taxon-title">{{ taxon.name }}</h1>
  31.                 {% if taxon.description %}
  32.                     <div class="taxon-description">{{ taxon.description }}</div>
  33.                 {% endif %}
  34.                 {% set taxonChildren = taxon.children  %}
  35.                 {% if taxonChildren|length %}
  36.                     <h4 class="title d-md-none">{{ 'app.ui.taxon.subtaxons' | trans }}</h4>
  37.                     <div class="subtaxons row row-cols-2 g-3 mb-5 row-cols-sm-3 d-md-none">
  38.                         {% for child in taxonChildren %}
  39.                             {% if child.enabled %}
  40.                                 <div class="subtaxons-item col">
  41.                                     <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>
  42.                                 </div>
  43.                             {% endif %}
  44.                         {% endfor %}
  45.                     </div>
  46.                 {% endif %}
  47.                 {% include '@SyliusShop/Product/Index/_main.html.twig' with { 'taxon': taxon } %}
  48.             </div>
  49.         </div>
  50.     {% elseif taxon.parent and taxon.parent.isRoot() %}
  51.         <div class="catalog catalog-taxon">
  52.             {#{{ dump(taxon) }}#}
  53.             <div class="taxon mb-4">
  54.                 <h1 class="custom-display-4 text-center">{{ taxon.name }}</h1>
  55.                 {% if taxon.description is not empty %}
  56.                     <div class="description">
  57.                         {{ taxon.description|raw }}
  58.                     </div>
  59.                 {% endif %}
  60.             </div>
  61.             {% for taxonItem in menuTaxons %}
  62.                 {#{{ dump(taxonItem) }}#}
  63.                 {% set taxonItemImage = taxonItem.imagesByType('catalog') is not empty %}
  64.                 <div class="taxon-item row py-4{% if not loop.first %} mt-6{% endif%}{% if loop.index is odd %} bg-light{% endif %}">
  65.                     {% if taxonItem.imagesByType('catalog') is not empty %}
  66.                         <div class="taxon-item-img-wrap d-none d-lg-block col-lg-6 col-xxxxl-5 col-xxxxxl-4 ps-lg-4">
  67.                             <a href="{{ path('sylius_shop_product_index', {'slug': taxonItem.redirect ?: taxonItem.slug, '_locale': taxonItem.translation.locale}) }}">
  68.                                 {#<picture>#}
  69.                                 {#    <source srcset="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_desktop') }}" media="(min-width: 992px)">#}
  70.                                 {#    <source srcset="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_mobile') }}">#}
  71.                                 {#    <img class="taxon-item-img" src="{{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_original') }}" alt="{{ taxonItem.name }}">#}
  72.                                 {#</picture>#}
  73.                                 <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 }}">
  74.                             </a>
  75.                         </div>
  76.                     {% endif %}
  77.                     <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 %}">
  78.                         <div class="taxon-item-text-content{# p-4#}">
  79.                             <h2 class="taxon-item-title custom-display-7 mb-0 text-center d-flex flex-column justify-content-center text-lg-start"
  80.                                 onclick="window.location.href='{{ path('sylius_shop_product_index', {'slug': taxonItem.redirect ?: taxonItem.slug, '_locale': taxonItem.translation.locale}) }}'"
  81.                                 {% if taxonItemImage %}style="background-image: url({{ taxonItem.imagesByType('catalog').first.path|imagine_filter('app_shop_taxon_catalog_mobile') }});"{% endif %}
  82.                             >
  83.                                 <span class="taxon-item-title-text">{{ taxonItem.name }}</span>
  84.                             </h2>
  85.                             {% if taxonItem.description is not empty %}
  86.                                 <div class="description fw-normal mt-3">{{ taxonItem.description|raw }}</div>
  87.                             {% endif %}
  88.                             {{ render(url('app_shop_products_by_label_code_and_taxon_slug', {
  89.                                 'labelCode': 'top',
  90.                                 'taxonSlug': taxonItem.redirect ?: taxonItem.slug,
  91.                                 'count': 20,
  92.                                 'template': '@SyliusShop/Product/Box/_top_products_slider.html.twig'
  93.                             })) }}
  94.                         </div>
  95.                     </div>
  96.                     {#<div class="link">#}
  97.                     {#    <a href="{{ path('sylius_shop_product_index', {'slug': taxonItem.slug, '_locale': taxonItem.translation.locale})  }}">{{ 'app.ui.taxon.view' | trans }}</a>#}
  98.                     {#</div>#}
  99.                     {#                    <div class="col-12 mt-4 text-end">#}
  100.                     {#                        <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>#}
  101.                     {#                    </div>#}
  102.                 </div>
  103.             {% endfor %}
  104.         </div>
  105.     {% endif %}
  106. {% endblock %}