Any way to keep filters consistent

macodocious
Tourist
11 0 1

Hello, is there any way to keep filters consistent?

This is the snippet of code I have right now:

 

<div class="product-single__price-{{- section.id -}}">
        <div id="price" class="price">
          <span  id="ProductPrice-{{- section.id -}}" class="amount price-new">
            <span class="money">
              {{- current_variant.price | money_with_currency -}}
            </span>
          </span>                  
        {%- if current_variant.compare_at_price > current_variant.price -%}                    
          <span id="ComparePrice-{{- section.id -}}" class="amount price-old{%- unless current_variant.compare_at_price 
           > current_variant.price %}{{- " hide" -}}{%- endunless -%}"> 
            <span class="money">
              {%- if current_variant.compare_at_price > current_variant.price -%}
              {{- current_variant.compare_at_price | money_with_currency -}}

          {%- if settings.product_sale_badge != '' and current_variant.compare_at_price > current_variant.price -%}
          <div class="sale {% if settings.product_sale_badge != '0' %}percentage{% endif %}{% unless 
          current_variant.compare_at_price > current_variant.price %} hide{% endunless %}">
          {%- if settings.product_sale_badge == '0' -%}
          {{- 'products.product.sale' | t -}}
          {%- else -%}
          -{{current_variant.compare_at_price | minus:current_variant.price | times:100.0 | 
          divided_by:current_variant.compare_at_price | ceil }}%
          {%- endif -%}
          </div>
          {%- endif -%}

              {%- endif -%}
            </span>
          </span>
          {%- endif -%}
        </div>
      </div>

 

 

The problem I'm having is, every time I select a variant, the snippet changes to the default which is:

<div class="product-single__price-{{- section.id -}}" with-sale>
        <div id="price" class="price">
          <span  id="ProductPrice-{{- section.id -}}" class="amount price-new">
            <span class="money">
              {{- current_variant.price | money -}}
            </span>
          </span>
        {%- if current_variant.compare_at_price > current_variant.price -%}                    
          <span id="ComparePrice-{{- section.id -}}" class="amount price-old{%- unless current_variant.compare_at_price 
           > current_variant.price %}{{- " hide" -}}{%- endunless -%}"> 
            <span class="money">
              {%- if current_variant.compare_at_price > current_variant.price -%}
              {{- current_variant.compare_at_price | money -}}
              {%- endif -%}
            </span>
          </span>
          {%- endif -%}
        </div>
      </div>

 

It removes the sales percentage box and removes the currency ISO code, any solutions?

0 Likes