JsonApi: Stock level mixed with f_catid when fetching products

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!
User avatar
nvdid
Posts: 15
Joined: 14 Feb 2024, 20:56

JsonApi: Stock level mixed with f_catid when fetching products

Post by nvdid » 05 Apr 2024, 17:20

Hi dear aimeos team

Fetching products from options.meta.resources.product shows all products, which is expected.
But when I add filter[f_catid] it shows only products in stock.
Is there a way to show all products regardless of stock in that case?
Also couldn't find a filter for stock when fetching products. Is there any? For example to show only products in stock or maybe filter products with stock level more that 10.

Aimeos: 2023.10
PHP: 8.1.2
Env: Linux

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

Re: JsonApi: Stock level mixed with f_catid when fetching products

Post by aimeos » 07 Apr 2024, 11:53

The f_catid parameter doesn't filter by product.instock property so there must be something else:
- https://github.com/aimeos/ai-client-jso ... d.php#L373
- https://github.com/aimeos/ai-controller ... #L218-L254
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
nvdid
Posts: 15
Joined: 14 Feb 2024, 20:56

Re: JsonApi: Stock level mixed with f_catid when fetching products

Post by nvdid » 07 Apr 2024, 19:25

Thanks for the info. Fixed! I forgot to run the cronjobs and the index was not fresh :roll:

Post Reply