Jump to content

Recommended Posts

Good Day

I would like to know where I can edit the API PHP code to send requests for updated stock levels from my supplier.

I have read the Prestashop Webservices tutorial and know how to create access to the Webservice, and have also got the code and setup instructions from my supplier.

All I need to know now is where to put the code to send the requests, and if there is any additional code that I need to insert to send regular requests for updated stock levels, as I would like this update to be synchronized with the stock levels of my supplier.

Your help in this regard will be greatly appreciated.

Thank You

Share this post

Link to post
Share on other sites


Right now i have a situation  close to your problem, where i need to check the supplier quantity for a product before a customer can add the product to cart. The issue is that i have two separate quantities for a product, my own and supplier 'probable' quantity.

I see two solutions here:

I need a second check for the available quantity of products that the customer want to add to it's cart through an API, in addition to internal prestashop stock.

For example, "Allow ordering of out-of-stock products" is set to NO. If the stock quantity of the given product is 250 and the customer inputs 250, all is good. If the input is 251, prestashop automatically disable the "Add to cart" button.

Additionally, in this checking, if my API returns 200, when the customer types 250 in quantity box, the message "there are not enough products in stock" should appear and "add to cart" button is disabled.

Or the second solution: use two warehouses, one is for my own quantity and the second one is the supplier quantity. But i need to constantly update the supplier warehouse with a cron for valid quantities and i don't know if i can do this with the Webservice.

How did you find a solution for your problem?

Thank you

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

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