Favorites / Wishlist

Allow site users to favorite posts and/or add products to a private wishlist. Supports use with SureCart v3+ products, WooCommerce products & any other post types. Query loops can then be used to output the users’ chosen items for each post type.

[Feature upcoming – Preview video – https://youtu.be/ospRrpQrAKo]

SCR 20240829 lcwh 1

Common Use Cases

  • Users creating a shopping wishlist of products to come back to purchase.
  • Users creating a ‘Favorite’ blog posts list.
  • Users building a ‘Watch Later’ list for videos posts.
  • Users saving their favorite recipes.

This element is in development. If there’s a particular use case you have, or any functionality that you’d like to see built here, send in feature requests with your idea. This documentation is still being written.

Favorite Button

The nestable Favorite Button element handles all the functionality, and can be used for four different behaviours..

  • Adding/removing current post/product from users’ favorites (from the current post being viewed or inside of a query loop).
  • Clear a specific item from the list (when used inside the user’s list).
  • Clear a list completely.
  • Display a count of the number of posts in the chosen list.

Access

By default the functionality is only available to site members when logged in, the buttons are automatically disabled for logged out users. The data (only the post ids for each list created) is stored in the user’s meta data for each time the user returns.

If you wish to allow logged out users to start to create their own lists before logging in, you can choose the ‘allow all’ option in the access setting. This will make the wishlist buttons active for all users, whether logged in or out. In this case, for logged out users they will be storing their choices as a 7 day cookie. After logging in, the data is then stored in the user’s meta data instead. (no cookies are added unless the user actually uses the button/feature)

(our recommendation is to encourage users to login to use this type of feature, as then they can visit the site from any device/browser and see their saved posts).

Favorites Query Loop

The Favorite Button element is for adding/removing items from a user’s list. But you’ll also need to display that list somewhere, which can be done using the Favorites Query Loop.

Simply set a query loop to ‘Favorites’ and then output your posts or products like you would any standard query loop. In the image below, we’re using the nestable table element to output the users product selection.

SCR 20240830 lxdo

To allow the user to remove items while viewing the list, use the Favorite Button element inside of the loop and set behavior to ‘Clear item from list’. Clicking that button with then remove that specific item from the list.

Tooltips

Tooltips can be added to the buttons to help with visual feedback for when the user interacts with the element. The tooltip content can be changed based on whether an item has been added, or removed, or if the button is disabled.

The usual tooltip settings are available for lots of behavior & style customization.

This content is restricted to BricksExtras users. Login if you already have an account.

Note that ‘Element Interactions’ must be enabled in BricksExtras > Misc settings.

This element adds new triggers to Bricks’ interactions options, so you can trigger actions based on the state of the element.

Triggers

Item added – triggered the moment the item has been successfully added
Item removed
– triggered the moment the item has been successfully removed
All Items Cleared
– triggered the moment all items have been successfully removed

Options

Delay – How long to wait after the event until the chosen action takes place .

This content is restricted to BricksExtras users. Login if you already have an account.