Get parent product
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 40
- Joined: 12 Jul 2018, 19:57
Get parent product
Hi there;
I have a selection products with 3 variants product, is there a way to know what is the parent product of those variants ?
Thanks
I have a selection products with 3 variants product, is there a way to know what is the parent product of those variants ?
Thanks
--
Jorge A Ramirez
System Engineer
PHP Developer
Jorge A Ramirez
System Engineer
PHP Developer
Re: Get parent product
You can search for the parent product in 2018.10 using:
Code: Select all
$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
$criteria = $manager->createSearch();
$func = $criteria->createFunction( 'product:has', ['product', 'default', '<prodid>'] );
$criteria->setConditions( $criteria->compare( '!=', $func, null ) );
$items = $manager->searchItems( $criteria );
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
-
- Posts: 40
- Joined: 12 Jul 2018, 19:57
Re: Get parent product
Does it work in 2017.07 ?
Thanks
Thanks
--
Jorge A Ramirez
System Engineer
PHP Developer
Jorge A Ramirez
System Engineer
PHP Developer
Re: Get parent product
No, but you should update nevertheless because 2018.07 isn't supported any more 2018.10 is the new LTS version.
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
-
- Posts: 40
- Joined: 12 Jul 2018, 19:57
Re: Get parent product
Sorry 2018.07, it does it work in that version?
--
Jorge A Ramirez
System Engineer
PHP Developer
Jorge A Ramirez
System Engineer
PHP Developer
Re: Get parent product
Also no. It's new in 2018.10 and you should upgrade too. The upgrade between that versions should be smooth.
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