How to add a recently viewed products section to your Shopify store


How to add a recently viewed products section to your Shopify store
We recently developed a module for our Shopify Theme Newport and wanted to share the files with the community. We are considering putting this into a Twigs for Timber bundle but for now we are just hosting it on Github.


  • - jQuery
  • - jQuery Cookie
  • - Shopify Ajax API
  • - Spin.js

The snippet below will automatically require these assets so all you have to do is include the snippet into your product.liquid file and it will start working right away.


  • - Simple to install
  • - Converts more sales
  • - Helps customers navigate
  • - Easy to customize
  • - Fully responsive

This is very simple stuff so let’s dive in.

Step 1:

Getting the code. Copy the code below to your clipboard.

Step 2:

Creating the snippet

Next we need to create a snippet to allow for our pages to show the module

See the image below to create a Snippet in your Shopify store.

Goto the themes section of your Shopify Admin Panel.

Edit your Shopify theme settings

Now create a new snippet called recently-viewed.liquid

Screen Shot 2015-10-01 at 4.22.34 PM

Step 3:

Paste the code from the Gist in “Step 1″ into the new file.

Screen Shot 2015-10-01 at 4.23.29 PM

Step 4:

Include the code on your product details page where you want the products to show up.

Step 5:

You should now be able to start visiting products and see them show up on each product details page. The script is aware of product presence so you can place it on any page by repeating step 4 with the new template file.

recently viewed products


Tim Matheson

Tim is a software engineer and computer software consultant based in Newport Beach, CA. He has worked with hundreds of companies implementing custom software-as-a-solution business administration tools. Tim's specialty is streamlining process using software for small to large businesses. When he's not saving the internet from dismal failure he enjoys riding his bike along the beach, and the occasional cup of coffee.

Leave a Reply

Your email address will not be published. Required fields are marked *