Let me try to help you and provide couple of possible scenarios for you. First of all, it is important to know, when does Spryker need to know product prices on the frontend:
- To display price to the customer, f.e. product details (comes from Redis)
- To be able to sort product list by price and be able to filter by price range (Elastic search)
- When product is added to cart, and any other cart-related operations - apply voucher, re-order, etc etc. In this case calculation is done on the backend side, see how it works here: https://documentation.spryker.com/v4/docs/calculation-3-0
Whenever you make a decision, make sure to consider these 3 points.
Now let’s check possible options on how to get the price.
Scenario 1: Spryker is taking care
From your description, it seems like you’re dealing with B2B shop. In Spryker, we do have “customer”-specific prices, they are defined per merchant relation, you can have a look about this feature here: https://documentation.spryker.com/docs/price-per-merchant-relation-feature-overview
So in this case, you have to import corresp. information into Spryker (ideally - pre-calculated customer prices) and it will take care about the rest.
Scenario 2: ERP (or any price-service)
Depending on how many final records are there and how often they change, storing them keeping them up-to-date on the Spryker side can be quite tricky. On top of that, in complex system it is often the case when ERP (or another “price provider” in micro-service oriented systems) is responsible for final price calculation.
If this is your case, and you have reliable system that can quickly give you the price, based on customer/product-sku - then you can implement a Service in Spryker (https://documentation.spryker.com/v4/docs/modularity-and-shop-suite) which will communicate with the external price provider directly. You can query this external system both from Yves and Zed to cover points 1-3 that I mentioned in the beginning.
Then, you have all kinds of options in front of you, depending on what price service can offer, f.e:
- Introduce bulk requests and get prices for many products at once;
- Make multiple requests in parallel, using Guzzle promises;
- On the frontend (Yves), introduce ajax requests which will load prices to improve responsiveness of your shop.
So this can be a good starting point for you. You can comment my points and provide some more details so we can focus on the right direction.
Solutions Architect @ Spryker