fix: sort option not getting created again

staging
Tejas Chari 2023-11-22 10:50:29 +05:30
parent b95409bcd7
commit ac4e31fdf4
2 changed files with 18 additions and 52 deletions

View File

@ -24,38 +24,41 @@
*}
<div id="js-product-list-top" class="bg-white">
<div class="relative z-40" role="dialog" aria-modal="true">
<div class="fixed inset-0 z-50 flex">
<div id="product-list-top-filters" class="relative mr-auto flex h-full w-screen md:w-64 flex-col overflow-y-auto bg-white py-4 pb-12 shadow-xl">
<div class="flex items-center justify-between px-4">
<h2 class="text-lg font-medium text-gray-900">Filters</h2>
<button id="hide_filters" type="button" class="-mr-2 flex h-10 w-10 items-center justify-center rounded-md bg-white p-2 text-gray-400">
<span class="sr-only">Close menu</span>
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-x" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M18 6l-12 12"></path>
<path d="M6 6l12 12"></path>
<!-- Show Filters Button -->
<div class="flex flex-row-reverse">
<button id="show-filters" type="button" class="flex space-x-2 items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-filter" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" />
</svg>
<span> Filter </span>
</button>
</div>
<!-- Off Screen Canvas Menu For Filters -->
<div class="relative z-40" role="dialog" aria-modal="true">
<div id="product-list-top-filters" class="fixed inset-0 z-50 flex hidden">
<div class="relative mr-auto flex h-full w-screen md:w-64 flex-col overflow-y-auto bg-white py-4 pb-12 shadow-xl">
<div class="flex items-center justify-between px-4">
<h2 class="text-lg font-medium text-gray-900">Filters</h2>
</div>
<form class="mt-4 border-t border-gray-200">
{block name='sort_by'}
{include file='catalog/_partials/sort-orders.tpl' sort_orders=$listing.sort_orders}
{/block}
{if !empty($listing.rendered_facets)}
{include file='catalog/_partials/facets.tpl'}
{else}
<div></div>
{/if}
</form>
</div>
</div>
</div>
<div class="flex flex-row-reverse">
{block name='sort_by'}
{include file='catalog/_partials/sort-orders.tpl' sort_orders=$listing.sort_orders}
{/block}
</div>
</div>
{*
<div id="js-product-list-top" class="flex w-full flex-col lg:flex-row lg:justify-between">
<button id="show_filters" class=""> Filter </button>

View File

@ -23,42 +23,6 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="th-accordion">
<div class="th-accordion-item border-t border-gray-200 px-4 py-4">
<h3 class="-mx-2 -my-3 flow-root">
<!-- Expand/collapse section button -->
<button id="show-sort-by" type="button" class="th-accordion-item-trigger flex w-full items-center justify-between bg-white px-2 py-3 text-gray-400 hover:text-gray-500" aria-controls="filter-section-mobile-0" aria-expanded="false">
<span class="font-medium text-gray-900">
Sort By
</span>
<span class="ml-6 flex items-center">
<!-- Expand icon, show/hide based on section open state. -->
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-chevron-down" width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M6 9l6 6l6 -6"></path>
</svg>
</span>
</button>
</h3>
<!-- Filter section, show/hide based on section state. -->
<div class="pt-6 hidden th-accordion-item-content" id="filter-section-sort-by">
<div class="flex flex-col w-full gap-4">
{foreach from=$listing.sort_orders item=sort_order}
<a
rel="nofollow"
href="{$sort_order.url}"
class="select-list text-sm shrink-0 {['current' => $sort_order.current, 'js-search-link' => true]|classnames}"
>
{$sort_order.label}
</a>
{/foreach}
</div>
</div>
</div>
</div>
{*
<div class="relative flex gap-2 lg:items-center top-4 lg:top-0">
<div class="relative flex-1 max-w-[140px] group">
<button
@ -86,4 +50,3 @@
</div>
</div>
</div>
*}