This plugin adds functionality to the existing Element Query fluent interface allowing you to filter and order elements by whether they have been recently viewed by the user.

Just like 'recently viewed products' on Amazon.

'Views' can be automatically tracked based on URLs visited by the user and displaying is as easy as:

{% set recentBlogPosts = craft.entries.section('blogPosts').recentlyViewed().orderByDateViewed().limit(3).all() %}

The plugin will work with any element type, including Commerce products and any custom elements from other plugins.

If you don't want to auto-track views, or you'd like to track views on elements which can't be natively linked to a specific URL (such as Assets or tags) you can manually track views like so:

{% do craft.recentlyViewed.track(element) %}

Where element can be anything that implements craft\base\ElementInterface.

Plus $5/year after one year.

Installation Instructions

To install this plugin, copy the command above to your terminal.

Active Installs
67
Version
1.0.3
License
Craft
Compatibility
Craft 3, Craft 4
Last release
January 10, 2019
Activity (30 days)
0
Closed Issues
0
Open Issues
0
Merged PRs
0
Open PRs