Retrieve attributes from products
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: 1
- Joined: 31 Jul 2017, 13:57
Retrieve attributes from products
Hi, i need to retrieve some attributes weight, height width and length from products(sorry about my bad english rsrs). this informations is for the delivery service.
i have searched about this but not find what i want. i hope someone can help me. im grateful
i have searched about this but not find what i want. i hope someone can help me. im grateful
Re: Retrieve attributes from products
In the delivery services, you have the basket available including the products to be bought. They contain the product ID (article or selection ID) and the product code (always the article code). Weight/height/length/width are product properties you can retrieve with
You can also use this condition if you always need the articles:
Code: Select all
$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
$search = $manager->createSearch(true);
$search->setConditions( $search->compare( '==', 'product.id', <list of product ids> ) );
$search->setSlice( 0, 0x7fffffff );
foreach( $manager->searchItems( $search, ['product/property'] ) as $productItem ) {
$propItems = $productItem->getPropertyItems();
}
Code: Select all
$search->setConditions( $search->compare( '==', 'product.code', <list of product codes> ) );
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