Page 1 of 1

Retrieve stock level on product detail page

Posted: 08 Aug 2017, 00:17
by Luis
I need to be able to retrieve and print the actual stock level directly on the catalog/details section for each individual product. Thanks for any help in advance.

Re: Retrieve stock level on product detail page

Posted: 08 Aug 2017, 08:26
by aimeos
You mean in the PHP templates and without waiting for the XHR stock level request to finish?

Re: Retrieve stock level on product detail page

Posted: 08 Aug 2017, 21:58
by Luis
I would love to be able to do it both ways. On the PHP templates directly and through the Ajax request.

Re: Retrieve stock level on product detail page

Posted: 09 Aug 2017, 11:23
by aimeos
There data is already available via XHR and you can exchange its template if you want to display that in a different manor:
https://github.com/aimeos/ai-client-htm ... efault.php

To have the stock level available in the catalog list and detail view too, you need to implement a decorator that retrieves the stock levels via the controller (https://github.com/aimeos/ai-controller ... /Iface.php) and adds that data to the view:
https://aimeos.org/docs/Developers/Html ... components