A favorite list is a collection of products explicitly saved by a user or a group of users – typically to save a product for later or as a public wish list. Favorite lists can be created and managed from frontend by users interacting with the Customer Center app – or from the backend using the Favorite Lists node (Figure 1.1).
To create a favorite list from the backend:
- Navigate to either Favorites for users or Favorites for groups
- Click Add in the toolbar
- Enter a Name and select a user/user group this list should be active for
If the favorite list is for a single user, it may be marked as the Default favorite list – many tags relate only to the default favorite list, and setups with a single and default favorite list are somewhat easier to build & maintain.
Products may be added to a favorite list from either the backend or from. To add a product to a favorite list from the backend:
- Navigate to either Favorites for users or Favorites for groups and open the favorite list
- Click Add product in the toolbar and select one or more products – or Add by SKU to enter a list of ProductNumbers or ProductIDs
- Click Save and close
In most cases, however, you want to make it possible for your registered users to add and remove products from their favorite lists by themselves. In that case, you can use a list of tags and loops to render Add to/Remove from favorites buttons – or something equivalent.
Here is an example to use inside a Products loop in a standard product list template:
This code example checks some basic properties of each product – whether it is in a favorite list or not, whether it is in the Default list or not. In the second part of the example we loop through all favorite lists belonging to the logged in users and render an appropriate add/remove link for each.
Registered users can view and manager their favorite lists via the Customer Center app – using the sections called My Lists. In broad terms you must:
- Add a favorites list section to the Customer Center menu layout template
- Render favorites lists and list details using the My List and My List details templates
To show a favorite list to anonymous users you should also:
- Create a page for showing a favorite list to someone and add the Show List app to it
- In the Customer Center, select his page as the Public List page in the Links section
The Show List app is a very simple app – it consists of a template for rendering a favorite list to anonymous users. The context is set by adding a PublishID parameter to the query string when linking people to the page, e.g. /ecommerce/show-list-app?PublishedID=Q1wFhUp5iN – the PublishID value is autogenerated when a favorite list is created and is available from the favorite list templates in the customer center.
Of course, there’s a template tag which does all this for you - Ecom:CustomerCenter.List.PublicURL.
Both Customer Center templates also contain tags for emailing a favorite list to someone – the layout and content of this email is controlled using the My List Email Settings (Figure 3.1).
|Field name||Data type||Length|
|Field name||Data type||Length|