Add Our Snippet to Your Theme (Legacy Themes)

Getting Started

When to use this guide

This guide is for older Shopify themes that do not support app blocks (pre-Online Store 2.0). If your theme supports app blocks, use the standard app block integration instead.

Prerequisites

  • You have installed the app and subscribed to a plan

Step 1: Open theme code

Open the theme editor and access your theme's code files.

Opening the theme code editor

Step 2: Copy required files

Copy two files: one to the assets directory and one to the snippets directory. You will find these files at the bottom of the page.

Copying files to assets and snippets directories

Step 3: Add translation strings

Add the following to your /locales/en.default.json file:

"eprel_label": {
  "title": "Product information sheet",
  "alt_text": "Energy efficiency label",
  "link_to_eprel_db": "More in EU EPREL Database"
},
Adding translation strings to the locale file

Step 4: Add the snippet

Use the following Liquid code to render the energy label where you want it to appear:

{% render 'eprel-at-price',
    product: product_resource,
    show_label: true,
    use_overlay: true,
    color: '#92979E',
    eprel_arrow_max_height: 30,
    eprel_container_justify_content: 'center'
%}
Adding the Liquid snippet to the theme

Important

The correct naming of the product variable depends on your theme — for example, sometimes it is referred to as just "product" instead of "product_resource". Consult your theme developer if you are unsure, or contact our support.

Add Our Snippet to Your Theme (Legacy Themes) | EPREL Label Buddy Docs