Re: Final Sale Tag on collection / product page when tagged

Final Sale Tag on collection / product page when tagged

Kenton2
Shopify Partner
16 0 1

Hi All, 

 

I would like to create a 'Final Sale' tag ( in the highlighted area below ) similar to how the tag 'Save 30%' is displayed on product pages.

 

Capture.PNG

 

This tag would need to be variant specific as some sizes or colors might not be on sale or be final sale.

 

Would the best way to go about this be a variant metafield that can be added to the specific variants? Just exploring ideas to try and figure out the best way to go about this display issue. 

 

Any and all ideas welcome. Running Warehouse .

Replies 3 (3)

Sweet_Savior_3
Shopify Partner
1336 102 138

Hello @Kenton2 

 

Yes, as per your requirement going with variant meta field will be a best idea. As you also have to hide show the badge based on variant.

 

Thanks

Don't forget to like and accept the solution to help others store owners.
Looking for an expert or Have any queries ? Send query to the Inbox
Coffee Tip ? Pay to shopify.dev.34@gmail.com
From Less To Further !!!
Kenton2
Shopify Partner
16 0 1

Do you have any suggestions on where to input the code?

 

I was unable to figure out which section contains the sale trigger to have that 30% off appear.

Kenton2
Shopify Partner
16 0 1

I had assumed it was this snippet 

 

{%- endif -%}

{%- capture product_labels -%}
{%- for tag in product.tags -%}
{%- if tag contains '__label:' -%}
<span class="product-label product-label--custom1">{{ tag | split: '__label:' | last }}</span>
{%- endif -%}

{%- if tag contains '__label1:' -%}
<span class="product-label product-label--custom1">{{ tag | split: '__label1:' | last }}</span>
{%- endif -%}

{%- if tag contains '__label2:' -%}
<span class="product-label product-label--custom2">{{ tag | split: '__label2:' | last }}</span>
{%- endif -%}
{%- endfor -%}

{%- if settings.show_discount -%}
{%- assign savings = 0 -%}

{%- if settings.discount_mode == 'percentage' -%}
{%- assign savings = selected_variant.compare_at_price | minus: selected_variant.price | times: 100.0 | divided_by: selected_variant.compare_at_price | round | append: '%' -%}
{%- else -%}
{%- capture savings -%}<span>{{ selected_variant.compare_at_price | minus: selected_variant.price | money }}</span>{%- endcapture -%}
{%- endif -%}

<span class="product-label product-label--on-sale" {% unless selected_variant.price < selected_variant.compare_at_price %}style="display: none"{% endunless %}>{{ 'collection.product.discount_html' | t: savings: savings }}</span>
{%- endif -%}
{%- endcapture -%}

{%- if product_labels != blank -%}
<div class="product-meta__label-list">
{{- product_labels -}}
</div>
{%- endif -%}