Note: Spartacus 4.x is no longer maintained. Please upgrade to the latest version.
Note: Spartacus 4.x was tested with SAP Commerce Cloud versions 1905 to 2205. Spartacus 4.x has not been verified to work with (and is not guaranteed to work with) SAP Commerce Cloud 2211 or later releases.
Note: This feature is introduced with version 1.4 of the Spartacus libraries.
The Wish List feature lets you save products for later viewing.
You can add products to a wish list from the product details page. If you are not signed in, the “Add to Wish List” option will indicate that you need to be logged in before you can add a product to the wish list.
Once you have added items to the wish list, you can view the contents of your wish list through the Wish list option in the My Account menu.
The wish list feature consists of the
AddToWishListComponent and the
WishListService component. Both of these components are CMS driven and can be configured in SmartEdit. You can also customize these components in Spartacus using CMS component mapping. For more information, see Customizing CMS Components.
A user cannot have more than one wish list. Furthermore, each wish list is tied to a specific user, so a wish list cannot be shared with other users. Finally, it is not possible to add a product to a wish list if that product is out of stock.
Disabling Wish Lists
The wish list feature is enabled by default in Spartacus.
The only way to disable wish lists is through the CMS. You can disable wish lists by making changes to the
spartacussampledata extension, or to your custom AddOn, as follows:
WishListLinkby removing the following line from the relevant
;;WishListLink;Wish List Link;/my-account/wishlist;WishListLink;WishListLink;;loggedInUser
Note: There is a
cms-responsive-content.impexfile for each base site.
Remove the link from the
WishListLinkfrom the following line in the relevant
;;SiteLinksSlot;Slot contains some links;true;OrdersLink,WishListLink,StoreFinderLink,ContactUsLink,HelpLink
WishListNavNodeby removing the following line from the relevant
WishListNavNodeEntryby removing the following line from the relevant
Remove all references of
You can also do these steps in Backoffice.