Kurt07 Posted August 16, 2019 Share Posted August 16, 2019 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 Link to comment Share on other sites More sharing options...
N3OGeorgy Posted October 3, 2019 Share Posted October 3, 2019 Hello, 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now