Better understanding of Productstock plugin !

How to configure and adapt Aimeos based shops as developer
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!
sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

Better understanding of Productstock plugin !

Post by sixbynine » 20 Jun 2018, 09:01

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
Last edited by sixbynine on 21 Jun 2018, 07:41, edited 2 times in total.

cayarabin
Posts: 1
Joined: 20 Jun 2018, 11:04

Re: Better understanding of Productstock plugin !

Post by cayarabin » 20 Jun 2018, 11:08

yes

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Better understanding of Productstock plugin !

Post by aimeos » 21 Jun 2018, 08:59

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

Re: Better understanding of Productstock plugin !

Post by sixbynine » 25 Jun 2018, 08:09

Thank you very much !

Post Reply