Show the Percentage Saved Automatically

To show the percentage saved automatically, follow these steps:

  1. Duplicate themes, to create a backup copy.
  2. From "Shopify Admin", select Online Store.

    select online store 

  3. Select Actions.


  4. Select Edit code.

    Edit code 

  5. Under "Templates", select product.liquid.

    Note: If your theme contains sections you may find this code within product-template.liquid under "Sections" instead.

    select product.liquid 

  6. Copy and paste this code where you would like the savings percentage to appear:

    Note: This code can be placed anywhere, but we recommend it be placed under the product title or product price.

    <!-- Inserted by Bold Apps - Show discount percentage -->
    {% if product.metafields.inventory.ShappifySale == "true" %}
    {% if product.compare_at_price_min > product.price_min %}
    {% capture discount %}
    {{ product.compare_at_price_max | minus:product.price | times:100 | divided_by:product.compare_at_price_max }}%
    {% endcapture %}
    <span><em>{{ discount }} OFF</em></span>
    {% endif %}
    {% endif %}
    <!-- End Bold Code -->

    paste the code 

  7. Select Save.

    Select save 

That's it!

Next Steps:

Blog Posts: