Adding a Percentage OFF tag to the Venture theme.

Highlighted
New Member
8 0 0

Hi All, I hope someone can help me out here. I want to add a Percentage OFF tag to my store (Venture Theme), eg "You save 25%" or "25% off SRP" or something similar. I've seen a few requests before but no answers for this theme. There are other bits of code out there for other themes that may work but nothing saying where to put it that matches my theme.

Thank you in advance for any help you all can give.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
335 32 129

Hi, Darren!

This is May from Shopify.

Thank you for posting your question here! I am sure other merchants could benefit from your question as well, since this is a highly requested theme customization. Based on your question, I assume that you want a ‘Sale’ tag to appear on your product, on the collections page. Like this:

If this is what you are looking for, I did some testings on my test store, and was able to find how to do this customization! I do want to mention that I am not an expert in coding and the steps below might not be the best solution for your request. Before we begin, I strongly recommend duplicating your theme before making changes to your code, to ensure that your customers aren’t affected if you see any unintended results! After you make a duplicate, feel free to follow the steps below!

  1. From your admin, go to ‘Online Store > Actions > Edit Code’.

  2. In your ‘Snippets’ folder, select ‘product-card.liquid’ file.

  3. In this file, search for ‘products.product.on_sale’. If you are using a Mac, press Command + F to search or on Windows, press Control + F.

  4. Delete the entire line of 

    {{ 'products.product.on_sale' | t }}

     

  5. Paste the code below code to replace the code above

    {% if product.variants.size > 1 %}
      UP TO {{ product.compare_at_price_min | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_min | money_without_currency | times: 100 | replace: '.0', '' | append: "% OFF"}}
      {% else %}
        {{ product.compare_at_price_min | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_min | money_without_currency | times: 100 | replace: '.0', ''| append: "% OFF"}}
    {% endif %}

    This code will allow you to display ‘ x% OFF’ tag on your product. If your product has more than one variants, the tag will display as ‘UP TO x% OFF’.

  6. Click ‘Save’.

For future reference, if you would like to change your ‘SALE’ tag back to what you had before, you can always roll back to an older version of your theme. If you are not comfortable with making this change, I highly suggest reaching out to our Shopify Experts.  Alternatively, since Venture is a theme made and supported by Shopify, our theme support may be able to look into making the change as well if your account is eligible!

If this isn't quite what you were after, let me know and we can continue with our support.

Kind Regards,

May

Shopify Support



 

May | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

3 Likes
Highlighted
New Member
8 0 0

Hi May,

Thank you very much for your code and help, unfortunately it doesn't work for me.

Screen grab after code entered:

Store screen grab

 

Here's a screen grab of the code entered:

Coding added.

Feel free to tell me I'm being a bone head if its something obvious.

Regards

Darren

0 Likes
Highlighted
Shopify Staff
Shopify Staff
335 32 129

Hi again, Darren!

Thank you for your reply, and thank you for sending over some screenshots! The instructions above is to add a sale tag on your product card on the collections page, not on the products page. Thank you for clarifying though. If you’d like to show it on your products page, the steps to do it are very similar to the steps above, but instead, we’ll need to insert the code in different files.

  1. In the code editor, go to your ‘Sections’ folder and select ‘product-template.liquid’.

  2. Follow steps 3-6 from the instructions above on ‘product-template.liquid’.

  3. Then, head over to a different file called ‘featured-product.liquid’.

  4. Follow steps 3-6 on ‘featured-product.liquid’.

Don’t forget to save your changes! Now, all tags with ‘SALE’ text should be replaced with percent off tags.

Let me know if this helps. Feel free to reply back to this thread or contact our 24/7 support, and we’ll happily help!

Kind Regards,

May

Shopify Support


 

May | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

2 Likes
Highlighted
New Member
2 0 0

Thank you.  This is very helpful.  How do I show the same strike-through pricing for the product on the collections page (as shown in the image above, under the "High Five Guide")?  The comparative (strike-through) pricing shows up on the product page currently, but not on its collection page.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
335 32 129

Hi, Judy!

I am happy to hear that you found this helpful! I’m sorry to hear that you aren’t able to display the compare at price on your collections page. If you are using Venture theme, generally the strike-through price should show on the collections page automatically, unless you have made some modifications to your theme. For example, I’ve seen some stores that modified their collections page to show the starting price of a product, rather than the shown variant’s price. If you have this set up, this could likely be why the comparative prices aren’t showing. Another cause could be because of a bad code found within your theme.

Do you have your own developer that help you with your theme? If you do, you could consult with them to make the change. If you don’t, our Theme Support theme may be able to help you take a look into this in accordance with our design policy. If you wish to explore this route, feel free to follow back up and I’d be more than happy to continue on.

Kind Regards,

May

Shopify Support


 

May | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
New Member
2 0 0

Perhaps it's because I'm using the older version of Venture it is displayed this way.  I'd be grateful for the coding change needed to reflect the comparative pricing, rather than the starting price of the product.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
335 32 129

Absolutely, Judy!

I will send you an email to the email address attached to your forums account. Moving to email means I can authenticate your account and loop in our Themes support team. Keep your eyes peeled for the email. If you have any other questions, feel free to follow up here or via email.

Cheers,

May

Shopify Support

May | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
New Member
1 0 0

Hi @May! I followed your instructions exactly but only partially works with me. It keeps  showing "UP TO 0%". Do yo know why?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
335 32 129

Hey, @Microfone!

 

Sorry to hear that this isn't working for your store. I'd love to take a further look into this and figure out what might cause the issue. I will be sending you an email to the email address attached to your forum account. That way, I can gather more information about your store, and loop in our theme support team if needed. 

 

Keep your eyes peeled for that email!

 

May

May | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes