Skip to content

Favorite Products

The favorite products feature lets a logged-in visitor mark WooCommerce products as favorites and view them later. It requires BuddyPress (or BuddyBoss) for the profile tab, and it is turned off when BuddyVendor is active.

Turn on Allow Marking Products as Favorites on the Dokan settings tab. The option is stored as reign_options[dokan_option][mark_favorite] and is enabled by default on a fresh install. The setting is available only when BuddyPress or BuddyBoss is active. See Dokan Settings Tab.

When the feature is on and a visitor is logged in, a heart icon is added:

  • On single product pages, in the product summary.
  • On shop and archive listings, on each product before its title.

Clicking the heart toggles the product in the visitor’s favorites over Ajax. A filled heart means the product is a favorite; an outline heart means it is not. The icon does not appear for logged-out visitors.

A Favorite tab is added to the visitor’s own BuddyPress profile. It lists the products the visitor has marked, using the WooCommerce [products] shortcode limited to their favorite product IDs. The tab shows only on the visitor’s own profile.

When the visitor has no favorites, the tab shows a “No products match your selection” notice.

Favorites are stored in the rda_favorite_products user meta on the visitor’s account, as a list of product IDs. The Ajax handler validates that the submitted ID is a real product before saving, and requires a logged-in user and a valid nonce.

Developers can change the tab name and slug, and the number of products per page, with filters. See Hooks and Filters.