get product data at checkout process
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!
get product data at checkout process
Hey guys
Could you explain me how can I access order products data during the checkout process? I'm trying:
$orderBaseItem->getProducts() returns me an empty array.
But it saved at DB well, and I can access all products data at Orders History page from the same object Aimeos\MShop\Order\Item\Base\Standard.
But I need it at my process() too.
Thanks!
Could you explain me how can I access order products data during the checkout process? I'm trying:
Code: Select all
public function process( \Aimeos\MShop\Order\Item\Iface $order, array $params = [] )
{
$orderBaseItem = $this->getOrderBase( $order->getBaseId() );
print_r(get_class($orderBaseItem)); // Aimeos\MShop\Order\Item\Base\Standard
echo '<br/>PRODUCTS:<br/>';
print_r($orderBaseItem->getProducts());
}
But it saved at DB well, and I can access all products data at Orders History page from the same object Aimeos\MShop\Order\Item\Base\Standard.
But I need it at my process() too.
Thanks!
Laravel 6.18.19 | php 7.4.7 | Xubuntu | Aimeos Laravel 2019.10.5
Re: get product data at checkout process
There's a second parameter for the getOrderBase() method:
https://github.com/aimeos/aimeos-core/b ... e.php#L523
Pass one of these as second parameter:
The second one will also fetch address and coupon data (https://github.com/aimeos/aimeos-core/b ... se.php#L28)
https://github.com/aimeos/aimeos-core/b ... e.php#L523
Pass one of these as second parameter:
Code: Select all
$parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_SERVICE | \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT;
$parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL;
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