Theme guide
Show recently viewed products on Shopify, without an app
What you’ll need
The theme editor (to add a Custom Liquid block; no code editing)
How to get this: The theme editor
- Online Store › Themes › Edit theme (on a copy of your theme if you want to test first).
- Add section or Add block › Custom Liquid, paste the code, then Save.
Your settings for the feature (for example your free shipping amount or countdown end date)
Make my recently viewed section
Add it
- In the Liquid Snippet Studio choose Recently viewed products, and set the heading and how many to show.
- Online Store › Themes › Customize › Products › Default product.
- Add section › Custom Liquid, paste, and place it near the bottom of the page. Save.
- Optional: add a second copy to the home page so returning shoppers see where they left off.
How it works
- Product pages save the product’s handle in the shopper’s browser (localStorage), newest first, up to 30.
- The section reads each product from Shopify’s public /products/handle.js, so prices, images and sold-out status are always current.
- Deleted products drop out by themselves; sold-out ones are hidden unless you choose to show them.
- It stays hidden until a shopper has viewed another product, so new visitors see nothing empty.
Privacy
Nothing leaves the shopper’s device and nothing identifies them, so it isn’t tracking. It also means the list doesn’t follow them to another phone or computer.
Related tools and guides
- Add a wishlist without an app
Liquid Snippet Studio