Last Products Viewed in Store for WooCommerce

By Daniel Esparza

0+ active installationsVersion 1.1.0

Shows the products recently viewed in your store with the [last-products-viewed-store] shortcode, using the js-cookie 3.0.5 library.

Description

Last Products Viewed in Store for WooCommerce lets your visitors easily return to the products they have recently viewed in your WooCommerce store.

Main features:

  1. Shortcode [last-products-viewed-store] to show the list of viewed products on any page, post or widget.
  2. Browser storage with js-cookie v3.0.5 (bundled, no external CDN).
  3. History of up to 10 products, ordered from most recent to oldest.
  4. Settings page in the admin to turn tracking on or off.
  5. Translation ready: all strings are ready to be translated.

Video

Third-party libraries

  • js-cookie 3.0.5 — MIT — https://github.com/js-cookie/js-cookie

Installation

  1. Upload the last-products-viewed-store folder to /wp-content/plugins/.
  2. Activate the plugin through the Plugins menu in WordPress (WooCommerce must be active).
  3. Go to Products Viewed in the admin menu and make sure Enable plugin is checked.
  4. Add the shortcode [last-products-viewed-store] to any page, post or widget.

FAQ

Can I change the maximum number of products shown?

In this version it is fixed at 10.

What happens if WooCommerce is not installed?

WooCommerce is required. WordPress will not activate the plugin without it, and the shortcode shows nothing.

Where is the data stored?

The plugin saves the product IDs in the vistos cookie in the visitor’s browser, for 7 days.

On which pages are products tracked?

On single product pages, including product templates built with page builders such as Elementor.

Screenshots

Changelog

1.1.0

  • Fixed a fatal error when WooCommerce is not active. Declared the WooCommerce dependency (Requires Plugins) and HPOS compatibility.
  • The tracking script now loads only on single product pages and gets the product ID from WordPress, so it also works with page builder templates.
  • Disabling the plugin now stops tracking viewed products.
  • When the plugin is disabled, the shortcode shows nothing.
  • The stylesheet now loads only on pages that contain the shortcode.
  • Settings page: added the “Settings saved” notice.
  • Interface strings in English, ready for translation on translate.wordpress.org.
  • Removed cookie code from uninstall, which had no effect.
  • Plugin header: added Requires at least, Requires PHP and License URI.

1.0.0

  • Initial release.
  • Viewed products tracking with js-cookie v3.0.5.
  • Shortcode [last-products-viewed-store].
  • Settings page in the dashboard.
  • List of up to 10 most recent products.