{% sw_extends '@Storefront/storefront/component/product/card/box.html.twig' %}
{# overwrites S360ListingViewSwitch Plugin logic #}
{% block component_product_box_include %}
{% set listingViewAllowed = true %}
{# ensure that list view wont get rendered for some box types and pages #}
{% if layout == 'minimal' %}
{% set layout = 'minimal-adjusted' %}
{% set listingViewAllowed = false %}
{% endif %}
{# if search page (all condition need to be checked since controller changing) #}
{% if activeRoute in ["widgets.search.pagelet.v2", "frontend.search.page", "frontend.search.s360searchreload"] %}
{% set listingViewAllowed = false %}
{% endif %}
{% if listingViewAllowed and app.request.cookies.get('s360ListingViewMode') is same as('list') %}
{% set listingColumns = config('S360ListingViewSwitch.config.listingClases') %}
<div class="s360-listing-view cms-listing-col {{ config('S360ListingViewSwitch.config.listingClases') }}">
{% sw_include '@Storefront/solution360/listingviewswitch/product-list.html.twig' %}
</div>
{% else %}
<div class="cms-listing-col {{ listingColumns }}">
{% if layout is empty %}
{% set layout = 'standard' %}
{% endif %}
{% sw_include "@Storefront/storefront/component/product/card/box-" ~ layout ~ ".html.twig" ignore missing %}
</div>
{% endif %}
{% endblock %}