Interface customer net price

Hello experts
New to this forum. and also new with Spryker as platform.
er are using SAP as out ERP system.

Currently I’m involved in a project where we are implementing a new shop build on Spryker platform. In this project, many questions are coming up for discutions. And many we have an answer too. But there is one I want to add here, to also se what your experience is. and that is Net price for customers. Net price is then list price minus dicount. eg. 100-25 = 75, so net price is 75. Our price calculation is way more complex than this example.

There are 2 solutions on the table
1: have ERP to calculate all the net price for all customers and products.
2: set up a web service based solution where Spryker can ask for price for the customer.

In senario 1 the database on Spryker side need to store all the pre-calculated prices. will be around 5.5 Million rows (will be more). And every time a price is changed or a discount is changed on ERP side, we need to also update the database on Spryker side with a new calculated price.

In senario 2 the net price for the customer is calculated “on the fly” by a call form spryker.

Can I ask you what is your experience with handling customer net price in shop in product pages?

Regards, Olaf

Hi Olaf,

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:

  1. To display price to the customer, f.e. product details (comes from Redis)
  2. To be able to sort product list by price and be able to filter by price range (Elastic search)
  3. 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:

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:

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 ( 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:

  1. Introduce bulk requests and get prices for many products at once;
  2. Make multiple requests in parallel, using Guzzle promises;
  3. 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.

Kind regards,
Andriy Netseplyayev
Solutions Architect @ Spryker