We're busy developing a B2B webshop and i'm running into the following situation.
The customer uses an AX-coupling to provide us with products. All products are being delivered to us without any prices. The idea is that an customer logs in onto the webshop. Depending on the deptorgroup he is in, he sees prices specific for him/her. This way every user that logs in can have it's own prices.
What we want to do now is that on productgroup pages we're lazy loading the prices through an webservice call. The productgroups are shown first, and asynchronously all prices for the products in the current overview are being retrieved and replaced using javascript when the results arive from the webservice.
In the shoppingcart and productdetailpages we also want to get the actual prices for the currently logged in customer, only this time from code since performance is less relevant here. I've tried setting up a priceprovider for this. This partially works because at the moment all prices (productgroup pages, productdetail, shoppingcart in the header and the shoppingcart itsself) are requested through this priceprovider. In the backend the created cart first looks fine, also the grandtotal for the cart is correct. Also the details of the order look good because this overview is rendered through the same priceprovider.
All this said now the actual question;
- Is the price provider the right place to change the unitprice of a product whenever the visitor is in the shoppingcart?
- If the price provider is the right place, will these calculations be made correclty for the order?
- Does anyone have any good suggestions or any experience with these kind of situations?