Show stock level in suggestions

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Show stock level in suggestions

Post by boettner » 29 Jul 2015, 17:01

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.

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

Re: Show stock level in suggestions

Post by aimeos » 30 Jul 2015, 10:23

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).

Post Reply