Store and use prices previously fetched

We have some products that we don’t store the price for in the PIM. When we list the product, we get the price from a third party API. To reduce the number of calls to the API, we would like to use the price we get when listing the products, when we add the product the cart.

The Cart.Add method doesn’t allow us to pass the price as an argument, so we have currently passed som additional product information as JSON in the comments, and we are then parsing it in the OrderRowFactory and adjust the price that way.

Is there any better way to achieve what we are looking for?

Litium version: 7.2.3

Try to use OrderCarrier.AdditionalOrderInfo instead if possible.

The scenario for getting and showing prices from external sources can be found in the developer training:

1. Get prices from external source
2. Use distributed cache and distributed lock to store prices in redis

Full sample can be found here

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.