Create a Shareable Wishlist using Product Collections in Sitecore OrderCloud

Introduction

A Wishlist can be implemented using Product Collections resource in Sitecore OrderCloud. But first, let us revise a few basic concepts in Sitecore OrderCloud related to Product Collections.

What is a Product Collection? A Product Collection is a new OrderCloud resource that enables buyer users to save lists of products. This feature can be used to build features like "Save For Later" (moving products from an active Order to a ProductCollection), favorite products, or custom wishlists.

How Many Products Can be added to a Product Collection?

· ProductCollections have a limit of 500 products each

How Many Product Collections can a single user maintain?

· There is no limit on how many ProductCollections an individual buyer user can create.

Sitecore OrderCloud recently added a new property to the Product Collection entity called AccessLevel. When this property is set to Shareable, it allows the users from the same buyer organization to access the collection. Even unregistered users within the same buyer organization can access the collection.

Steps to add a new Wishlist Here are the steps to add a new Wishlist that can be shared with other users from the same organization:

  1. Create a shareable Product Collection for a buyer user.

    a. POST /me/productCollections

    b. Add an ID, Name and Set the Access Level to Shareable

custom

  1. Add Product to Product Collection

custom

  1. Now the buyers in the organization can access the Wishlist using the GET call

custom

  1. To retrieve the products inside a product collection, you will need to use the “{{baseApiUrl}}/v1/me/productcollections/Holiday/Products” API

custom

Since the accelevel of the product collection is Shareable, every buyer user in the organization will have access to the product collection.

If you have any questions or would like to learn more, feel free to reach out.