Map product/list in catalog tree
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!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- QuốcTrungNguyễnHoàng
- Posts: 14
- Joined: 06 Aug 2019, 03:22
Map product/list in catalog tree
Hi, I'm new in Aimeos.
I have a problem, i wan't to get all product and product/lists ( media, text, price ) in specific catalog tree. But when i use MShop Catalog Manager in decorator, it just map catalog with product detail, note have product/lists.
How can i map product/lists in catalog tree.
pls Help me. Tks.
I have a problem, i wan't to get all product and product/lists ( media, text, price ) in specific catalog tree. But when i use MShop Catalog Manager in decorator, it just map catalog with product detail, note have product/lists.
How can i map product/lists in catalog tree.
pls Help me. Tks.
- QuốcTrungNguyễnHoàng
- Posts: 14
- Joined: 06 Aug 2019, 03:22
Re: Map product/list in catalog tree
I use Laravel framwork with lastest Aimeos package
Re: Map product/list in catalog tree
Use that code:
Please keep in mind that this only works if you have categories with a small set of products referenced. Otherwise, you will quickly get into performance and out of memory problems!
Code: Select all
use \Aimeos\Shop\Facades\Catalog;
$catalog = Catalog::uses(['text', 'media', 'price', 'product']);
// retrieve whole tree
$node = $catalog->getTree();
// or find single node by code
$node = $catalog->find( '<catalog code' );
// or get single node by ID
$node = $catalog->get( '<catalog ID>' );
// and get associated products
$products = $node->getRefItems( 'product' );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star