Page 1 of 1

Show stock level in suggestions

Posted: 29 Jul 2015, 17:01
by boettner
Hi again,

I need to display the addbasket button in product suggestion lists and it should reflect the current stock level. The button itself is no problem but I can´t tie the deferred JSON request to the list. The suggestion list and the product detail are displayed on the same page, so both sections need their stock levels on all addtobasket buttons.

Can you help me with that please?

Cheers
Robert.

Re: Show stock level in suggestions

Posted: 30 Jul 2015, 10:23
by aimeos
boettner wrote: I need to display the addbasket button in product suggestion lists and it should reflect the current stock level. The button itself is no problem but I can´t tie the deferred JSON request to the list. The suggestion list and the product detail are displayed on the same page, so both sections need their stock levels on all addtobasket buttons.
Displaying the stock levels in these lists should be rather easy. You need to do two things:
- Add the ".product" and ".stock" CSS classes to the product items in the lists of the template (check if there are any CSS side effects)
- Add a script link in the header template which contains the stock URL including the product IDs (this should be configurable so big sites can reduce the number of requests)

For consistency, this should be done with the other products lists too (bought together products, maybe related products in the basket).