From 49f81fb95f20ae4b193fa0286f6bf5fe5eeec2c4 Mon Sep 17 00:00:00 2001
From: Dinesh Salunke <dineshsalunke@consultbop.com>
Date: Tue, 5 Dec 2023 13:35:11 +0530
Subject: [PATCH] fix: add missing closing tag

---
 templates/catalog/_partials/facets.tpl | 111 ++++++++++---------------
 1 file changed, 45 insertions(+), 66 deletions(-)

diff --git a/templates/catalog/_partials/facets.tpl b/templates/catalog/_partials/facets.tpl
index 3093768..af176b3 100644
--- a/templates/catalog/_partials/facets.tpl
+++ b/templates/catalog/_partials/facets.tpl
@@ -24,77 +24,56 @@
  *}
 {if $facets|count}
   <div id="search_filters">
-    {*
-    <div id="search_filter_buttons" class="flex hidden">
-      {block name='facets_clearall_button'}
-        {if $activeFilters|count}
-          <button id="_desktop_search_filters_clear_all"  data-search-url="{$clear_all_link}"  class="flex w-6 h-6 flex items-center justify-center select-none js-search-filters-clear-all">
-            <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-filter-off hover:stroke-2 cursor-pointer" width="16" height="16" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
-              <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
-              <path d="M8 4h12v2.172a2 2 0 0 1 -.586 1.414l-3.914 3.914m-.5 3.5v4l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227"></path>
-              <path d="M3 3l18 18"></path>
-            </svg>
-          </button>
-        {else}
-          <button id="_desktop_search_filters" class="flex w-6 h-6 items-center justify-center select-none">
-            <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-filter hover:stroke-2 cursor-pointer" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round">
-              <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
-              <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"></path>
-            </svg>
-          </button>
-        {/if}
-      {/block}
-    </div>
-    *}
     <div class="th-accordion">
-    {foreach from=$facets item="facet"}
-      {if !$facet.displayed}
-        {continue}
-      {/if}
-      {if $facet.widgetType === 'dropdown'}
-        <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-filters-{$facet.label}" data-filter-name="{$facet.label}" 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">
-                {$active_found = false}
+      {foreach from=$facets item="facet"}
+        {if !$facet.displayed}
+          {continue}
+        {/if}
+        {if $facet.widgetType === 'dropdown'}
+          <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-filters-{$facet.label}" data-filter-name="{$facet.label}" 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">
+                  {$active_found = false}
+                  {foreach from=$facet.filters item="filter"}
+                    {if $filter.active}
+                      {$filter.label}
+                      {$active_found = true}
+                    {/if}
+                  {/foreach}
+                  {if !$active_found}
+                    {$facet.label}
+                  {/if}
+                </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="th-accordion-item-content pt-6 hidden" id="filter-section-{$facet.label}" data-filter-name="{$facet.label}">
+              <div class="flex flex-wrap w-full">
                 {foreach from=$facet.filters item="filter"}
-                  {if $filter.active}
-                    {$filter.label}
-                    {$active_found = true}
+                  {if !$filter.active}
+                    <a
+                      rel="nofollow"
+                      href="{$filter.nextEncodedFacetsURL}"
+                      class="select-list text-sm w-1/2 p-2 text-center"
+                    >
+                      {$filter.label}
+                    </a>
                   {/if}
                 {/foreach}
-                {if !$active_found}
-                  {$facet.label}
-                {/if}
-              </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="th-accordion-item-content pt-6 hidden" id="filter-section-{$facet.label}" data-filter-name="{$facet.label}">
-            <div class="flex flex-wrap w-full">
-              {foreach from=$facet.filters item="filter"}
-                {if !$filter.active}
-                  <a
-                    rel="nofollow"
-                    href="{$filter.nextEncodedFacetsURL}"
-                    class="select-list text-sm w-1/2 p-2 text-center"
-                  >
-                    {$filter.label}
-                  </a>
-                {/if}
-              {/foreach}
+              </div>
             </div>
           </div>
-        </div>
-      {/if}
-    {/foreach}
+        {/if}
+      {/foreach}
+    </div>
   </div>
 {/if}