Hub/Theme/Recently Viewed Products Row
Task IntentTheme

Recently Viewed Products Row

Display a row of recently viewed products using browser local storage for personalization.

What This Sidekick Query Does

Display a row of recently viewed products using browser local storage for personalization.

Prompts

Copy, adapt, and run this directly in Shopify Sidekick.

Create a recently viewed products section that tracks which products a customer has viewed using browser localStorage and displays them in a horizontal scrollable row. Show up to [MAX_PRODUCTS] products (e.g., 8). Each product card should display: product image, title, price, and a Quick Add button. The section should only appear if the customer has viewed at least [MIN_PRODUCTS] products (e.g., 2). On each product page load, save the product handle, title, image URL, price, and URL to localStorage. Use the section heading [SECTION_HEADING] (e.g., Recently Viewed). The row should scroll horizontally with arrow buttons on desktop and swipe on mobile. Include a Clear History link. Do not use cookies – localStorage only. Generate the Liquid section, JavaScript, and CSS.

Expected Output

Display a row of recently viewed products using browser local storage for personalization.

Tips to Improve Results

Copy the prompt above
Open Shopify Sidekick in your Shopify admin
Paste the prompt and replace the bracketed placeholders with your details
Review Sidekick's response and apply the suggestions