Hi,
Could you please advise how to Add all the products that have a badge percentage discount more than 60% OFF in a single collection
Hi,
Could you please advise how to Add all the products that have a badge percentage discount more than 60% OFF in a single collection
Hey @hmurrar
If you’re on Shopify Plus, you can use Shopify Scripts to dynamically group products with a discount greater than 60% into a collection.
OR
Shopify does not have a built-in option to filter products by discount percentage in the admin. However, you can achieve this by using a tag.
Create an Automated Collection:
Save the Collection:
OR
If you cannot tag products manually, you can use Liquid code to dynamically display products with a discount over 60% on a custom page.
{% assign discount_collection = '' %}
{% for product in collections.all.products %}
{% for variant in product.variants %}
{% assign original_price = variant.compare_at_price %}
{% assign current_price = variant.price %}
{% if original_price and original_price > current_price %}
{% assign discount_percentage = 100 | minus: (current_price | times: 100) | divided_by: original_price %}
{% if discount_percentage > 60 %}
- {{ product.title }} - {{ discount_percentage | round }}% off
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
Hi @hmurrar ,
You can easily accomplish this with the assistance of Product Labels. Follow these steps:
Step 1: Install and enable the app.
Step 2: Create a text badge with the variable {discount_percentage}
Step 3: Select the collection where you want to display the label
Step 4: In the Advanced section, set the Discount range from 60% to 100%.
Step 5: In General settings, choose to show on collection pages
Hi @anupam1607 , thanks for your response, I can use only the last solution you provided for created new page.
I did exactly what you have mentioned, but the result was empty page.
Is there any way to create a code to add the tag Automatically for all prodcuts that have 60%Off and above
Hi @Amanda_Fordeer , thanks for your reply, this feacture you have mentioned is available only for PAID Plan