Jump to content

[Prestashop 1.7] Search for a product in another database.

Recommended Posts


I would like to create a module, or maybe edit the file to order,
so that when ordering a customer, if a product is not available in my stock, it will automatically search for it in the stock of one of my supplier, via their api they have provided me, without it being perceptible by the customer.
I managed to create a small program to retrieve all of their items through their api, apparently advanced stock management could do that but is no more available in prestashop 1.7.5.

I don’t see how I can use this to automatically search in their database if a product is no longer in stock in mine.
I’m a beginner in development.

Thanks and sorry for my bad english.

Share this post

Link to post
Share on other sites

Uhhh, you know, it's tricky, you need to do it legally so the person who is buying something is aware of these changes.

I suggest to modify CartController.php, there are methods to check wether product is in stock or not, alter those methods to create API call when products are out of stock and put in cart different one... but you have to inform customers about these changes

Share this post

Link to post
Share on other sites
  • 8 months later...


I have almost the same problem. What i understand from @anis42 is that he doesn't want to change the product. He only wants to check the stock for that product in his supplier, if in the shop is out of stock, through an API.

It is possible do do this in a module ? @anis42, did you solve your problem? 

Thank you

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More