Get product category
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!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Get product category
Use the methods of the item instead:
Check the product item interface for reference:
https://github.com/aimeos/aimeos-core/b ... hp#L27-L47
Code: Select all
$product->getCatalogItems();
$product->getStockItems();
https://github.com/aimeos/aimeos-core/b ... hp#L27-L47
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Get product category
Laravel framework version: 9.26.1aimeos wrote: ↑02 Apr 2021, 17:16 Use the methods of the item instead:Check the product item interface for reference:Code: Select all
$product->getCatalogItems(); $product->getStockItems();
https://github.com/aimeos/aimeos-core/b ... hp#L27-L47
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.9
Environment: Linux
Hello,
I am trying to output the categories of the products in the following template:
templates/client/html/catalog/detail/body.php
I want them to show in the list of characteristics tab.
How should I go about doing this in my version of aimeos?
I have tried a few methods from this thread, like adding 'catalog' => ['text'] to the domains config, but I either end up with errors or the categories don't show up for the product. I expect the categories to be present somewhere in the $view when I dd($view) in the template.
The latest answer $product->getCatalogItems(); also shows this error in the logs:
Called unknown macro "getCatalogItems" on class "Aimeos\MShop\Product\Item\Standard"
Also the link provided leads to a 404 page.
Re: Get product category
Since 2022.01, you can get the categories using:
Code: Select all
$producItem->getRefItems( 'catalog' );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Get product category
I think this works but should they be appearing under -node?aimeos wrote: ↑02 Sep 2022, 14:52 Since 2022.01, you can get the categories using:Code: Select all
$producItem->getRefItems( 'catalog' );
The other items, for example $mediaItems have them under #bdata.
How do I get them from inside the -node?
By the way, I noticed that I am posting in the wrong forum, I am working with Aimeos Laravel.
Re: Get product category
The catalog items will be under "listRefItems" if there are any available and you have to load them together with the product by passing "catalog" as part of the second parameter to search(). Depending on the component you want to fetch the categories, you can add the "catalog" domain by configuration. For list and detail views, they are already fetched:
- https://aimeos.org/docs/2022.x/config/c ... s/#domains
- https://aimeos.org/docs/2022.x/config/c ... l/#domains
- https://aimeos.org/docs/2022.x/config/c ... s/#domains
- https://aimeos.org/docs/2022.x/config/c ... l/#domains
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
