Code cleanup

This commit is contained in:
Bartłomiej Sęk 2024-10-25 10:39:09 +02:00
parent bd23ac13eb
commit 78f6db52d5

View file

@ -3,7 +3,10 @@
{% set items = [] %}
{% set items = items|merge([{ path: path('sylius_shop_homepage'), label: 'sylius.ui.home'|trans }]) %}
{% set items = items|merge([{
path: path('sylius_shop_homepage'),
label: 'sylius.ui.home'|trans
}]) %}
{% if product.mainTaxon is not null %}
{% set taxon = product.mainTaxon %}
@ -13,19 +16,25 @@
{% if ancestor.isRoot() or not ancestor.enabled %}
{% set items = items|merge([{ label: ancestor.name }]) %}
{% else %}
{% set items = items|merge([{ path: path('sylius_shop_product_index', {'slug': ancestor.slug, '_locale': ancestor.translation.locale}), label: ancestor.name }]) %}
{% set items = items|merge([{
path: path('sylius_shop_product_index',{'slug': ancestor.slug, '_locale': ancestor.translation.locale}),
label: ancestor.name }]) %}
{% endif %}
{% endfor %}
{% if taxon.enabled %}
{% set items = items|merge([{ path: path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}), label: taxon.name }]) %}
{% set items = items|merge([{
path: path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}),
label: taxon.name }]) %}
{% else %}
{% set items = items|merge([{ label: taxon.name }]) %}
{% endif %}
{% endif %}
{% if additional_items|length > 0 %}
{% set items = items|merge([{ label: product.name, path: path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }]) %}
{% set items = items|merge([{
label: product.name,
path: path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }]) %}
{% else %}
{% set items = items|merge([{ label: product.name, active: true }]) %}
{% endif %}