How to get product attribute properties from order

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!
Dhara1510
Posts: 15
Joined: 27 Apr 2019, 05:36

How to get product attribute properties from order

Post by Dhara1510 » 09 May 2019, 05:38

Hello,

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();
        }
}
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?

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

Re: How to get product attribute properties from order

Post by aimeos » 09 May 2019, 09:37

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply