Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#4437 by igorpdasilva
31 Jul 2017, 14:08
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
#4439 by aimeos
01 Aug 2017, 09:59
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
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();
}


You can also use this condition if you always need the articles:
Code: Select all$search->setConditions( $search->compare( '==', 'product.code', <list of product codes> ) );