Recently viewed products

Recently viewed products give customers a quick way to return to products they have already opened. WoodMart can display this history in a grid, list, or carousel anywhere you add a Products element.

recently viewed products on frontend
Recently viewed products displayed in a product grid.

How recently viewed products are stored

WoodMart automatically records product pages opened by the visitor and stores up to 12 of the most recently viewed product IDs in a browser cookie. The newest product appears first, and opening the same product again moves it back to the beginning of the history.

The cookie is stored for 7 days by default. The history belongs to the current browser and device; it is not saved in the customer account or synchronized between devices. Clearing or blocking the cookie resets the list.

Add recently viewed products to a page

  1. Edit the required page and add the Products block in Gutenberg or the Products (grid or carousel) element in Elementor or WPBakery.
  2. Set Data source to Recently Viewed Products.
  3. Choose a grid, list, or carousel layout and configure the number of products and other display settings.

For a complete description of the available layout and design controls, see the Products (grid or carousel) documentation.

Use AJAX with full-page caching

When Recently Viewed Products is selected as the data source, the Update with AJAX on page load option becomes available. Enable it when the page is served through full-page caching. The Products element will then request the current visitor’s cookie history after the cached page loads.

WPBakery Page Builder product source settings for a products grid or carousel, with data source set to Recently Viewed Products and AJAX update enabled
Select Recently Viewed Products as the data source and enable AJAX when using full-page caching.

Display the section globally

To display recently viewed products in the prefooter throughout the website:

  1. Navigate to Dashboard -> HTML Blocks and create an HTML Block.
  2. Add a Products block or element and set its data source to Recently Viewed Products.
  3. Navigate to Dashboard -> Theme Settings -> Footer -> Prefooter.
  4. Set Prefooter content to HTML Block, select the block you created, and save the Theme Settings.

See the HTML Blocks documentation for more information about creating and reusing HTML Blocks.