Shopify themes, liquid, logos, and UX
Hi Legends, i hope everyone is doing great..
I need a small help..
Iam using Dawn theme..and if a product is on sale it just shows as sale.. but how can i show the % on the badge as well?
any help would be appreciated..:)
Thanks in advance:)
{% if product.compare_at_price_max > product.price %}You Save {{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0'}}% {% endif %}
@saitejabandaru
try this code in the Product-template.liquid file.
it show the % and the remaining will be the custom code where you want to Display this into your Product.
Thanks for the reply @Zworthkey
I actually want it to appear on all of sales badges..home page ..product recommendations..how can i do that and wher can i paste the code ?
it's total customization work. and on which products you want to show the badges.
how much % like '10% save' .
For all this it takes time and you need a Developer for this.
or hire Someone to add these features into store. let me know if you need help from us.
We are always happy to help you.
Thank you.
Hi @saitejabandaru ,
To implement this you have to update the code for card-product.liquid to show impact globally.
Please refer the below code to implement the same.
{%- assign difference = card_product.compare_at_price | minus: card_product.price -%}
{%- assign float_difference = difference | times: 1.0 -%}
{%- assign discount_fraction = float_difference | divided_by: card_product.compare_at_price -%}
{%- assign discount_percentage = discount_fraction | times: 100 | round -%}
{{- discount_percentage }}
For line number where to update the code and implement it on product page kindly refer the below video.
Hope this will helps..
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024