Recently viewed
Show the products a visitor opened last, on any page, from their browser or, for logged-in customers, from their account.
On this page
Recently viewed products help a visitor go back to what they looked at. Smootify records each product page the visitor opens and gives you a card template to list those products anywhere: on the home page, in the cart, under a product. There is nothing to record by hand.
Note
Turn on Last Viewed in the Smootify dashboard. It is free on every plan. On your .webflow.io address it works for testing before you turn it on, but only turning it on adds the customer metafield Last Viewed (custom.last_viewed, a list of products) to Shopify, where a logged-in customer’s list is saved. In Shopify, under Settings > Custom data > Customers, check that this definition has Customer accounts access set to Read and write: Smootify creates it that way, but a definition that already existed keeps its own setting.
What counts as viewed
- A product page. A product is recorded when the visitor opens its page: the template page of your Products collection, at the address your site uses for products (
productsby default, set by theproductsBaseoption). A product seen in a card, a search result or the cart is not recorded. - The 10 most recent. The newest comes first. Opening a product again moves it to the front. On a product page, that product is already first in the list.
- Browser and account. Every visitor’s list is kept in their browser. For a customer logged in with customer accounts, it is also saved in their account, and the account list is the one shown when there is one.
Show the list
Add a Div block for the grid, and inside it a smootify-product with the custom attribute data-id="last-viewed". Design it as one product card: Smootify copies it once per product, and the copies go next to it. Only the first smootify-product with data-id="last-viewed" on the page is used.
limitsets how many cards show, 10 by default. Smootify keeps 10 products, so a higher number shows no more.- Inside the card, everything a product card can show works: see Product cards. Each card has the class
is-last-viewed-item.
Empty or not. Two conditions work anywhere on the page, as around the heading above:
The list has products
- Shows
- While the list has at least one product.
- Body
has-last-viewed, on the body only, not on the card template.
The list is empty
- Shows
- While the list is empty: until the visitor opens a product page.
- Body
- No
has-last-viewed.
More in the recently viewed cards.
Before you publish
Check these first
- The list stays empty. The product pages are not at the address Smootify expects. If your Products collection uses another URL, such as
product, setproductsBasein the Smootify options. - Nothing is recorded on the live site. Last Viewed is not turned on in the Smootify dashboard.
- The list does not follow the customer to another device. The customer is not logged in with customer accounts, or the Last Viewed metafield does not have Read and write customer accounts access in Shopify.
- Never more than 10 cards. Smootify keeps the 10 most recent products, whatever the
limit.