{% sw_extends '@Storefront/storefront/component/product/listing.html.twig' %}
{% if page and page is instanceof('Nd\\Fashion\\Page\\Manufacturer\\ProductManufacturerPage') %}
{% set dataUrl = url('frontend.productManufacturer.detail', { productManufacturerId: page.productManufacturerId }) %}
{% set filterUrl = url('frontend.productManufacturer.detail', { productManufacturerId: page.productManufacturerId }) %}
{% endif %}
{% set listingPagination = {
sidebar: sidebar,
params: params,
dataUrl: dataUrl,
filterUrl: filterUrl,
disableEmptyFilter: disableEmptyFilter,
snippets: {
resetAllButtonText: 'listing.filterPanelResetAll'|trans|sw_sanitize
}
} %}
{% block product_listing %}
<div class="md:flex items-end justify-between">
<h1 class="product-listing-name font-display font-bold text-3xl uppercase pt-3 pb-1">{{ page.header.navigation.active.name }}</h1>
<div class="grid-gap-2 items-center hidden lg:flex">
<div class="products-per-page flex grid-gap-1 text-sm text-grey-600"
data-products-per-page="true">
<select name="per-page" id="per-page" class="custom-select !pr-7">
{% set numbers = [12, 24, 36, 48, 72] %}
{% set getParameter = app.request.query.get('limit') + 0 %}
{% for item in numbers %}
<option value="{{ item }}"
{% if getParameter === item or searchResult.limit === item %}selected{% elseif loop.first %}{% endif %}>
{{ item }}
</option>
{% endfor %}
</select>
</div>
{% sw_include '@Storefront/storefront/component/custom-sorting.html.twig' with {
current: searchResult.sorting,
sortings: searchResult.availableSortings,
type: 'select'
} %}
</div>
</div>
<div class="cms-element-product-listing-wrapper relative"
data-listing-pagination="true"
data-listing-pagination-options='{{ paginationConfig }}'
data-listing="true"
data-listing-options='{{ listingPagination|json_encode }}'>
{% block element_product_listing_wrapper_content %}
<div class="cms-element-product-listing boxed-layout">
{% block element_product_listing_header %}
<section class="product-listing-header hidden lg:block">
<div class="product-listing-header-actions flex justify-between items-center pb-3 pt-1">
<div class="show-results text-sm text-grey-600">
{% set totalCurrent = searchResult.limit %}
{% if searchResult.limit > searchResult.total %}
{% set totalCurrent = searchResult.total %}
{% endif %}
{{ 'pages.listing.showingResults'|trans({ '%current%': totalCurrent, '%total%': searchResult.total })|sw_sanitize }}
</div>
</div>
</section>
{% endblock %}
{% block element_product_listing_row %}
<div class="cms-listing-row js-listing-wrapper grid grid-cols-2 grid-gap-2 md:grid-cols-3 xl:grid-cols-4">
{% if searchResult.total > 0 %}
{% block element_product_listing_col %}
{% for product in searchResult %}
<div class="product-card">
{% block element_product_listing_box %}
{% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
'layout': boxLayout,
'displayMode': displayMode
} %}
{% endblock %}
</div>
{% endfor %}
{% endblock %}
{% else %}
{% block element_product_listing_col_empty %}
<div class="cms-listing-col no-products-found col-span-full">
{% block element_product_listing_col_empty_alert %}
{% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
type: 'info',
content: 'listing.emptyResultMessage'|trans|sw_sanitize
} %}
{% endblock %}
</div>
{% endblock %}
{% endif %}
</div>
{% endblock %}
{% if searchResult.total > searchResult.limit %}
{% block element_product_listing_pagination_nav_bottom %}
{% sw_include '@Storefront/storefront/component/pagination.html.twig' with {
entities: searchResult,
criteria: searchResult.criteria,
paginationLocation: 'bottom',
} %}
{% endblock %}
{% endif %}
</div>
{% endblock %}
</div>
{% endblock %}