Recently Viewed Products
Show products visited in the current browser session, newest viewed first. This helps shoppers return to items they have already inspected without creating an account.
Enable and Prepare
- Activate WooCommerce and BricksUltimate.
- Open Bricks → BricksUltimate → Misc, enable Ultimate Woo Query Builder, and save.
- Reopen the Bricks editor so the query options refresh.
Under Bricks → BricksUltimate → Misc, leave Disable Recently Viewed Cookie unchecked to allow BU tracking. Tracking is active by default unless this setting disables it. Visit several real single-product URLs on the frontend in the same browser before testing the collection. A builder preview is not browsing-history evidence.
Create the Query Loop
- Add an outer Section or Block for the heading and layout. Keep the section heading outside the repeated item.
- Add an inner Block for one product card and enable Use query loop on that Block.
- Choose Ultimate Woo Query Builder as the query Type, then choose Recently Viewed Products under Woo query type.
- Enable Disable query merge where offered so the current page's main query does not unexpectedly constrain this custom collection.
- Configure the controls below and place the record's dynamic elements inside the repeated Block.
- Save and test on the frontend. Builder sample content is not a substitute for the live query result.
Controls and Behavior
| Control | How to use it |
|---|---|
| Number of items to show | Set how many stored products to display. Default: 3. |
| Category(IDs) / Category operator | Optionally restrict the history to selected category IDs. Products outside the category are omitted rather than replaced by unrelated items. |
| Stock, hidden products, free products | Configure the exposed filters. Set Hide free products to No explicitly if zero-priced items should remain eligible. |
| Ordering | The frontend reverses the saved IDs and preserves that order. There is no separate Order by or Order control. |
Design the Product Card
Inside the repeated Block, add a Product Image, a heading using the current product title, a product permalink, a WooCommerce price element, and a suitable add-to-cart control. Choose dynamic sources from the current loop item, not a hard-coded product. Keep the whole layout in the same product loop so image, title, price, and purchase action refer to the same product.
Set the outer wrapper to grid or flex, define responsive columns, and style one card. For a slider, use Slider (Nestable) and repeat its slide Block instead of repeating the whole slider. Configure slider arrows and breakpoints separately. Avoid nesting interactive buttons inside a fully linked card.
Cookie, Privacy, and Cache Behavior
The provider reads woocommerce_recently_viewed. When the BU tracking hook is enabled, it moves a revisited product to the end of the stored list, retains up to 15 product IDs, and writes a session cookie. It is browser-specific, not an account-wide history shared across devices.
Exclude personalized history output from shared page caching or use a correctly configured dynamic rendering strategy. Check cookie consent requirements for your site and test with consent both accepted and declined. Cached single-product pages can also bypass PHP tracking, so verify actual cookie updates in your environment.
Practical Example
Build a Continue Browsing section with 4 items. Visit products A, B, and C, then revisit A. On a non-cached test, the collection should begin with A, then C, then B, subject to the configured product filters.
Scope and Limitations
The current viewed product is not automatically excluded, and the provider does not track category views or abandoned carts. History can disappear when cookies are cleared or the session ends. Do not assume this limited personalized collection supports archive-style pagination.
Troubleshooting and Testing
No cookie or an empty history returns an empty list on the frontend. In the builder, recent products may be shown for design preview instead. If shoppers see someone else's history, check shared caching immediately.
Test the populated and empty states, desktop and mobile layouts, and any relevant AJAX refresh. Keep headings and decorative wrappers from leaving empty gaps when no eligible results exist. If a query type is missing, verify the feature toggle, WooCommerce activation, and editor reload before changing the layout.