How to get getRefItems('product') of bought together in catalog/detail?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
mr.zherart
Posts: 27
Joined: 04 Jun 2020, 14:00

How to get getRefItems('product') of bought together in catalog/detail?

Post by mr.zherart » 31 Mar 2021, 14:06

Hello, Aimeos.

My version is Laravel 2020.10.

Seems it is no way to get subproducts (or other) referenced items for bought together products on catalog detail? I need to get products on the "select" type product, but it is empty.

I can get bought-together items via:

Code: Select all

$boutghtItems = $detailProductItem->getRefItems('product', null, 'bought-together');
but in foreach for $boutghtItem will empty for select type.

Code: Select all

$boutghtItem->getRefItems('product', 'default', 'default') 
I tried to set up the product domain in any related manager for getting it, but it does not work.

Can you help please, how to do it, or what I do wrong? Thank you!

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

Re: How to get getRefItems('product') of bought together in catalog/detail?

Post by aimeos » 02 Apr 2021, 17:21

There's a decorator to prevent fetching huge amount of data accidentially or worse, being trapped in a recursion due to two products referencing each other. You can change the maximum depth of retrieving referenced items by configuration:
https://github.com/aimeos/aimeos-core/b ... hp#L40-L56
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mr.zherart
Posts: 27
Joined: 04 Jun 2020, 14:00

Re: How to get getRefItems('product') of bought together in catalog/detail?

Post by mr.zherart » 04 Apr 2021, 13:33

Thank you, I changed config maxdepth from 2 to 3, and all working great now!

Post Reply