Better understanding of Productstock plugin !
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Better understanding of Productstock plugin !
Hello,
I would like to have a better comprehension of the ProductStock plugin.
I read the documentation : This plug-in is applied in the basket and at the end of the checkout process
- I wonder where in the code the stock check is called.
- With the JSON API, when the product is out of stock, I can't find the error code/message thrown in the JSON body response, so I don't know how to manage it.
Thank you a lot in advance (one more time),
sbn
I would like to have a better comprehension of the ProductStock plugin.
I read the documentation : This plug-in is applied in the basket and at the end of the checkout process
- I wonder where in the code the stock check is called.
- With the JSON API, when the product is out of stock, I can't find the error code/message thrown in the JSON body response, so I don't know how to manage it.
Thank you a lot in advance (one more time),
sbn
Last edited by sixbynine on 21 Jun 2018, 07:41, edited 2 times in total.
Re: Better understanding of Productstock plugin !
The plugins are called when the basket (order base item) is modidified. Then, all which have registered themselves are notified about the change, e.g. in: https://github.com/aimeos/aimeos-core/b ... e.php#L219
When using the JSON API, the same basket controller method (addProduct()) is called and any exception caught is handled and should return a 404 with an appropriate message: https://github.com/aimeos/ai-client-jso ... d.php#L206
When using the JSON API, the same basket controller method (addProduct()) is called and any exception caught is handled and should return a 404 with an appropriate message: https://github.com/aimeos/ai-client-jso ... d.php#L206
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Better understanding of Productstock plugin !
Thank you very much !