ordercloud-api / headstart

A complete and opinionated eCommerce solution using OrderCloud as the backbone - built with .NET Core and Angular
MIT License
31 stars 74 forks source link

Add related products feature #271

Open crhistianramirez opened 3 years ago

crhistianramirez commented 3 years ago

This feature would allow admins to promote certain products and encourage customers to buy more.

To implement this we'll need to maintain product.xp.RelatedProductIDs for example:

{
    "ID": "my-awesome-product-id",
    "RelatedProductIDs": ["product1", "product2", "product3"]
}

On the admin side this could be a simple multi-select dropdown that allows the user to search for products via the /products endpoint and upon selection patches the product to include the related product.

On the buyer side When the user gets to the product detail page we can make a product list call via me/products with the product IDs. This would retrieve only the products the user can see and at the price they should see them at.

For example the following list call would retrieve the products (product1, product2, product3) based on visibility/pricing rules specific to that user.

/me/products?ID=product1|product2|product3

ajsuth commented 2 years ago

Ported related products implementation from triumph.

A few minor changes to the port.

TODO: