Jump to content

Set dynamic price via external API


Mattia98

Recommended Posts

Hello everybody, 

I need to change the price of some products dynamically for a group of customers. The price would be returned by an external webservice that is called by prestashop.
I use version 1.7, could someone tell me where in the code the call to the webservice could be implemented?
I read this article that could help me, but it refers to PS 8: https://webkul.com/blog/how-to-override-a-product-price-calculation-in-prestashop/

Link to comment
Share on other sites

I suggest not doing it dynamically, but creating a specific price for that group, storing that value there. This way you can query your API by some script from time to time, updating your specific prices.

Relying on external API during price calculation is a bad practice in my opinion.

Link to comment
Share on other sites

I would need to dynamically query the webservice because there are many price variations and setting them up on prestashop would be complicated. Obviously the call to the API should start only for customers belonging to a certain group (the minority) to avoid overloading the system.

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...