How to get product attribute properties from order
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!
How to get product attribute properties from order
Hello,
I have overridden the confirmAction and added my code.
using above I can get ordered product and interval details. I have also added price/media/properties for interval attributes. Can get selected interval name by `$orderProduct->getAttributeItems()[ 1 ]->getName();`. But i also want to get price/media/properties of attribute. How can i get it?
I have overridden the confirmAction and added my code.
Code: Select all
public function confirmAction()
{
foreach (app('config')->get('shop.page.checkout-confirm') as $name)
{
$params[ 'aiheader' ][ $name ] = Shop::get($name)->getHeader();
$params[ 'aibody' ][ $name ] = Shop::get($name)->getBody();
}
$context = App::make('\Aimeos\Shop\Base\Context')->get();
$baseManager = \Aimeos\MShop::create($context, 'order/base');
$search = $baseManager->createSearch();
$items = $baseManager->searchItems($search, ['order/base/product']);
$basket = reset($items);
foreach ($basket->getProducts() as $orderProduct)
{
$orderProduct->getAttributeItems()[ 1 ]->getName();
}
}
Re: How to get product attribute properties from order
This returns a random order not bound to the current user!
For retrieving the full attribute details, you have to use getAttributeId() and search for all items using the attribute manager.
For retrieving the full attribute details, you have to use getAttributeId() and search for all items using the attribute manager.
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