ordercloud-api/headstart

Add related products feature

crhistianramirez opened this issue · 1 comments

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

Ported related products implementation from triumph.

A few minor changes to the port.

  • Updated product is patched rather than put.
  • Resolved rendering the display title in the product details page.

TODO:

  • Existing incomplete incomplete implementation of related products to be cleaned up from product-details.component.ts, i.e. relatedProducts$.
  • Selected product in search modal is missing background colour to visibly indicate product selected.
  • The product card on the product details page can not be selected.
  • Localise Related Products static text in buyer and seller apps.