diff --git a/_dev/css/theme/override/bootstrap/_form.scss b/_dev/css/theme/override/bootstrap/_form.scss index 159a71e0..d6b7e751 100644 --- a/_dev/css/theme/override/bootstrap/_form.scss +++ b/_dev/css/theme/override/bootstrap/_form.scss @@ -1,3 +1,57 @@ .form-label { display: block; } + +.form-check-label-color { + display: flex; + cursor: pointer; + align-items: center; +} + +.form-check-color-content { + aspect-ratio: 1/1; + font-size: rem-calc(30px); + display: block; + border-radius: 50%; + border: 1px solid $border-color; + width: 1em; + position: relative; +} + +.form-check-checked-color { + position: absolute; + left: 50%; + top: 50%; + margin-top: -0.5em; + margin-left: -0.5em; + font-size: 0.6em; + opacity: 0; +} + +.form-check-checked-color-bright { + color: $gray-100; +} + +.form-check-color { + position: relative; + margin: 0; + min-height: auto; + padding-left: 0; + + .form-check-input-color { + position: absolute; + inset: 0; + margin: 0; + opacity: 0; + width: 100%; + height: 100%; + + &:checked { + ~ .form-check-label-color { + .form-check-checked-color { + opacity: 1; + } + } + } + } +} diff --git a/modules/ps_facetedsearch/views/templates/front/catalog/facets.tpl b/modules/ps_facetedsearch/views/templates/front/catalog/facets.tpl index 154da7ef..e4599168 100644 --- a/modules/ps_facetedsearch/views/templates/front/catalog/facets.tpl +++ b/modules/ps_facetedsearch/views/templates/front/catalog/facets.tpl @@ -1,27 +1,135 @@ -{** - * 2007-2019 PrestaShop. - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License 3.0 (AFL-3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * https://opensource.org/licenses/AFL-3.0 - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to http://www.prestashop.com for more information. - * - * @author PrestaShop SA - * @copyright 2007-2019 PrestaShop SA - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) - * International Registered Trademark & Property of PrestaShop SA - *} +{function renderCheckboxRadioFacet facet=null _collapse=true} + {if $facet} +
+ {foreach $facet.filters as $filter_key => $filter} + {if !$filter.displayed} + {continue} + {/if} +
+
+ + +
+
+ {/foreach} +
+ {/if} +{/function} + +{function renderDropdownFacet facet=null _collapse=true} + {if $facet} +
+
+ +
+
+ {/if} +{/function} + +{function renderSliderFacet facet=null _collapse=true _expand_id=null} + {foreach $facet.filters as $filter} +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+ {/foreach} +{/function}
{if isset($displayedFacets) && $displayedFacets|count} @@ -44,12 +152,15 @@ {/if} {/block} {foreach from=$displayedFacets item="facet"} + {$_expand_id = 10|mt_rand:100000} + {$_collapse = true} - {assign var=_expand_id value=10|mt_rand:100000} - {assign var=_collapse value=true} - {foreach from=$facet.filters item="filter"} - {if $filter.active}{assign var=_collapse value=false}{/if} + {foreach $facet.filters as $filter} + {if $filter.active} + {$_collapse = false} + {/if} {/foreach} +
{$facet.label} @@ -67,112 +178,20 @@ {if in_array($facet.widgetType, ['radio', 'checkbox'])} {block name='facet_item_other'} -
- {foreach from=$facet.filters key=filter_key item="filter"} - {if !$filter.displayed} - {continue} - {/if} -
-
- - -
-
- {/foreach} -
+ {renderCheckboxRadioFacet facet=$facet _collapse=$_collapse _expand_id=$_expand_id} {/block} - {elseif $facet.widgetType == 'dropdown'} {block name='facet_item_dropdown'} -
-
- -
-
+ {renderDropdownFacet facet=$facet _collapse=$_collapse _expand_id=$_expand_id} {/block} - {elseif $facet.widgetType == 'slider'} {block name='facet_item_slider'} - {foreach from=$facet.filters item="filter"} - -
-
-
-
-
-
- -
-
- -
-
-
-
-
- {/foreach} + {renderSliderFacet facet=$facet _collapse=$_collapse _expand_id=$_expand_id} {/block} {/if}
{/foreach} -
- {/if} - diff --git a/templates/catalog/_partials/product-variants.tpl b/templates/catalog/_partials/product-variants.tpl index 17d0c2bc..cc026184 100644 --- a/templates/catalog/_partials/product-variants.tpl +++ b/templates/catalog/_partials/product-variants.tpl @@ -42,19 +42,44 @@ {foreach from=$group.attributes key=id_attribute item=group_attribute}
  • -
    - - -