Shopify sections

Shopify recently viewed products: remembered in the browser, shown as a row

Shopify recently viewed products is a row that shows a shopper the products they opened last. Recently Viewed remembers up to 20 products in the shopper's own browser, in local storage, and shows 4 to 12 of them as a carousel, a grid or a compact row. Nothing is sent to a server, so the list does not follow a shopper to another device. The section stays hidden until there is something to show. In Section Store, Recently Viewed is free on every plan.

  • Layout: Carousel, Grid or Compact, with Carousel as the default
  • Quick add is off by default
  • Views are recorded by the block on the product template

Last checked:

Recently Viewed section rendered by Section Store with its sample content
Recently Viewed with its sample content and default settings: the Carousel layout with Portrait images, prices and the "Clear history" control.

When to use it

Useful in large catalogues, pointless in a shop with a handful of products

Use it when

  • Shoppers open many products and lose the one they likedThe row brings back the last 8 by default, up to 12. "Hide the product being viewed" is on, so the product page does not list itself.
  • You do not want a service that tracks visitors on a serverThe history is kept in the local storage of the shopper's browser and nowhere else. With "Show Clear history" on, which is the default, the shopper can empty it.
  • The row should not show an empty frame to new visitorsUntil the browser holds a history the section renders nothing, headline included. A first-time visitor on their first product page sees the page without it.
  • You are looking for a free section to begin withRecently Viewed costs nothing on any plan, quick add and all three layouts included.

Skip it when

  • The shop has very few productsThe row would repeat what the navigation already shows. Leave it out and let the menu do the work.
  • The list should follow a shopper from phone to laptopIt cannot, because it lives in one browser. That needs a service which stores views per customer account on a server.
  • You want the row on the home page onlyProduct views are recorded by the block on the product template, so the block has to be there as well. Add it with "Record views only (show nothing)" switched on and place a second, visible block on the home page.

In detail

The block on the product page records, the same or a second block displays

Each product page that carries the block adds its product to a list in the browser. The list is capped at 20 products, and "Number of products" decides how many of them the row shows, from 4 to 12. Recording and showing are separate jobs, which is why the record-only switch exists: one block remembers on product pages while another shows the row somewhere else.

Carousel is the default layout. Grid uses 5 columns on desktop and 2 on phones by default, adjustable from 2 to 6 and from 1 to 2. Compact is a slim row of small product tiles, meant for the bottom of any page.

The cards show price, compare-at price and a sale badge by default, and a second image on hover. If you write {percent} into the badge text, shoppers read the actual discount there, calculated from the compare-at price of each product. The vendor is off by default. "Card style" is Standard, with details under the image, or Minimal, centred with quieter text, and the image ratio is Square, Portrait or Tall.

"Quick add" turns the row from navigation into a place to buy. It is Off by default and can be a Button that appears on hover or a Plus icon that is always visible. What happens next is a setting too: by default the cart drawer of the theme opens, where one exists.

The default headline, "Recently viewed", is translated automatically into the shopper's language.

Two ways

localStorage and the Section Rendering API by hand, or the free block

Liquid runs on the server and has no object for what a visitor looked at, so every version of this feature stores product handles somewhere and renders the cards afterwards. Both ways below keep them in the browser.

Way 1

localStorage array plus Section Rendering API

Partly feasible. A generic outline without tested code; nothing here can be pasted into a theme as it stands.

  1. On product pages, push the product handle into a localStorage array, deduplicated and capped.
  2. To render, request each handle as /products/<handle>?section_id=<card section> through the Section Rendering API, or load /products/<handle>.js and build the cards from the data.
  3. Leave out the product being viewed and hide the wrapper while the array is empty.
  4. Plan for handles that no longer resolve, because a product can be deleted after it was stored.

Choose this if: The cards must look exactly like the theme's own product cards. The Section Rendering API route reuses them, and that makes the hand-built version the better choice for this requirement.

Way 2

The free Recently Viewed block

No cost on any plan and no code, on the condition that the shop runs an Online Store 2.0 theme.

  1. Add the app block to the product template first. Without it no views are recorded, whatever else you place.
  2. Choose the layout and the number of products in the builder, and switch on quick add if the row should sell directly.
  3. For a row on another page, place a second instance there; a section can exist several times with different settings. The documentation shows how blocks are placed.

Choose this if: Cards in the section's own style are fine and you do not want to write or maintain the script.

Builder settings

Every builder setting of Recently Viewed

"Number of products" and "Layout" shape the row, and "Quick add" decides whether shoppers can buy from it. Look at "Record views only (show nothing)" only if you run two blocks. Every row here is a builder setting; in the theme editor you meet just the app block with its picker, padding, max width and device toggles.

Products6
Number of productsConditional
Slider, 4–12
Default8
Hide the product being viewedConditional
On / off
DefaultOn
Record views only (show nothing)For a block that only remembers products, e.g. on product pages, while a second block shows them elsewhere.
On / off
DefaultOff
Show "Clear history"Conditional
On / off
DefaultOn
"Clear history" labelConditional
Text
DefaultClear history
Show priceConditional
On / off
DefaultOn
Content3
Eyebrow
Text
DefaultEmpty
HeadlineThe default headline is translated automatically into the shopper's language.
Text
DefaultRecently viewed
Subheadline
Text
DefaultEmpty
Layout4
LayoutCompact: a slim row of small product tiles, good at the bottom of any page.
Choice: Carousel, Grid, Compact
DefaultCarousel
Columns (Desktop)Conditional
Slider, 2–6
Default5
Columns (Mobile)Conditional
Slider, 1–2
Default2
Max Width
Slider, 320–1800 px
Default1400 px
Cards9
Card styleConditionalStandard: details under the image. Minimal: centred, quieter text.
Choice: Standard, Minimal
DefaultStandard
Image ratioConditional
Choice: Square, Portrait, Tall
DefaultPortrait
Show second image on hoverConditional
On / off
DefaultOn
Quick addOne click adds products without options. Products with options open a small picker with sizes and colours; sold-out ones are crossed out.
Choice: Off, Button (appears on hover), Plus icon (always visible)
DefaultOff
After adding to cartConditional
Choice: Open the cart drawer (if the theme has one), Show a confirmation, Go to the cart page
DefaultOpen the cart drawer (if the theme has one)
Show vendor
On / off
DefaultOff
Show compare-at price
On / off
DefaultOn
Show sale badgeConditional
On / off
DefaultOn
Sale badge textConditional{percent} is replaced with the real discount from the compare-at price, e.g. -{percent}%. The default is translated automatically.
Text
DefaultSale
Design7
Text Color
Colour
Default#1c1b19
Background Color
Colour
Defaulttransparent
Image background
Colour
Default#f5f3ef
Sale color
Colour
Default#b4532a
Button Color
Colour
Default#1c1b19
Button Text Color
Colour
Default#ffffff
Corner Radius
Slider, 0–24 px
Default8 px
Spacing1
Section Spacing
Spacing per device
DefaultTop padding 48 / 40 / 32 px

30 settings in 6 groups. These are settings in the Section Store builder, not theme editor settings: read from the app's section configuration, as of 2 Dec 2026. "Conditional" settings appear only once a related setting turns them on.

FAQ

Paste-in code, an invisible row, variants and weight

Recently Viewed is free in Section Store.

Set it up in the app builder and place it through the Section Store app block. No theme code.

Install on Shopify

Sources

Sources