Jump to content

How to update the cart prices in prestashop 1.6 after calling an outside webservice?


Recommended Posts

My client has a pricing engine that is a centralized system (this is using in many application ) which has the provision to add the discounts/coupons and their pricing engine has an API where we need to post the details of the products that is in the cart( as json request) and in response it calculates the discounts and provide the json response that has the details of the discounts (discount total, voucher code etc). Based on these response we have to apply the discounts to the cart (if any). The pricing engine's table also has the referencenumber which is unique and that is also same in the prestashop product table. So based on that only the pricing engine check whether there is discount or not. 

We are using prestashop 1.6 and started developing a module. 

We are planning to use the hookActionCartSave(). But the problem we are facing is that we don't know how to update the cart. We know that $cart->update() will update the cart. But not the pricing. How to apply the discounts and reprocess the cart? Please anyone have an idea?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...