Map product/list in catalog tree

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
QuốcTrungNguyễnHoàng
Posts: 14
Joined: 06 Aug 2019, 03:22

Map product/list in catalog tree

Post by QuốcTrungNguyễnHoàng » 06 Aug 2019, 03:33

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.

User avatar
QuốcTrungNguyễnHoàng
Posts: 14
Joined: 06 Aug 2019, 03:22

Re: Map product/list in catalog tree

Post by QuốcTrungNguyễnHoàng » 06 Aug 2019, 03:34

I use Laravel framwork with lastest Aimeos package

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

Re: Map product/list in catalog tree

Post by aimeos » 06 Aug 2019, 08:22

Use that code:

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' );
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!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply