Add Sales Icon to an Entire Collection

Follow

To add a sales icon to a collection preview if any product inside the collection is on sale, follow these steps:

  1. From Shopify's admin, select Online Store.

    select online store

  2. Select Actions.

    Actions

  3. Select Edit code.

    Edit code

  4. Under "Sections", select collection-list.liquid.

    Note: The name of this file will vary by theme but should have a similar title to this.

    select collection-list.liquid

  5. Add this code to the top of the file:

    {% include 'shappify-sales-icon-collection' %}

    add this code to the top of the file

  6. Select Save.

    select save

  7. Under "Snippets", select Add a new snippet.

    select add a new snippet

  8. In the "Create a new snippet called" field, enter shappify-sales-icon-collection.liquid

    enter shappify-sales-icon-for-collection.liquid

  9. Select Create snippet.

    select create snippet

  10. Copy and paste this code into the file:

    {% if product.metafields.inventory.ShappifySale == "true" %}
    <img class='shappify-sales-icon-product' src='//secure.shappify.com/apps/discount/icons/default/sale8.png' /><style> 
    .shappify-sales-icon-product{ 
     } 
    </style>
    {% endif %}

    copy and paste this code into the file

  11. Select Save.

    select save

That's it!

Next Steps:

Blog Posts:

0 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.