Get individual products from bundle product

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!
lockhart97
Posts: 11
Joined: 17 Aug 2023, 00:16

Get individual products from bundle product

Post by lockhart97 » 09 Sep 2023, 04:38

Laravel framework version: 10.18.0
Aimeos Laravel version: 2023.07
PHP Version: 8.2.8
Environment: Linux

Hello Aimeos,
I have bundle products and I want to get details of products added to that bundle. Is there any way to do that using JsonAPI or any other way. I looked through documentation and forums but I did not find any solution.

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

Re: Get individual products from bundle product

Post by aimeos » 09 Sep 2023, 05:05

Use "include=product" to get related products like bundled articles in one request with the bundle product.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

lockhart97
Posts: 11
Joined: 17 Aug 2023, 00:16

Re: Get individual products from bundle product

Post by lockhart97 » 09 Sep 2023, 05:48

using "include=product" returns only suggested products and products bought together, but not products in bundle.

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

Re: Get individual products from bundle product

Post by aimeos » 09 Sep 2023, 06:17

"include=product" returns bundle articles and variant articles of selection products too:
https://laravel.demo.aimeos.org/jsonapi ... oduct.type

Check your bundled products if it doesn't.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

lockhart97
Posts: 11
Joined: 17 Aug 2023, 00:16

Re: Get individual products from bundle product

Post by lockhart97 » 09 Sep 2023, 08:17

Yes, you are right. I checked, it's working.

But the problem is that when I add bundle products using "xml import", in admin panel it shows bundle products has products in bundle but these products are not returned using JsonAPI. Now, when I delete all products in bundle and add same products manually through admin panel, API now returns correct data.

What can be reason for this? Adding bundle products using "xml import" does not return products in bundle but other associated products like, suggested products are returned.

lockhart97
Posts: 11
Joined: 17 Aug 2023, 00:16

Re: Get individual products from bundle product

Post by lockhart97 » 09 Sep 2023, 08:28

lockhart97 wrote: 09 Sep 2023, 08:17 Yes, you are right. I checked, it's working.

But the problem is that when I add bundle products using "xml import", in admin panel it shows bundle products has products in bundle but these products are not returned using JsonAPI. Now, when I delete all products in bundle and add same products manually through admin panel, API now returns correct data.

What can be reason for this? Adding bundle products using "xml import" does not return products in bundle but other associated products like, suggested products are returned.
Got it. It was my mistake. After some hit and trial I found the problem. The products in bundle had "dateend" option set to year 2000. I set a date in future and it started returning correct data.

Thank you so much for the help.

Post Reply