Access Order info in Process()

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!
cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Access Order info in Process()

Post by cjr » 08 Jul 2020, 17:02

I am implementing a custom payment method and am trying to access the order info in the process() function.

$get_order = $this->getOrder($order);

$order_base = $this->getOrderBase($order->getBaseId(), \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL);


Both $this->getOrder() and $this->getOrderBase() return just an array with the original $order_id that gets passed in to the process() function. $order_base->getPrice() returns Null.

Is it possible to write raw queries in the process() function to pull the data I want?

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

Re: Access Order info in Process()

Post by aimeos » 10 Jul 2020, 17:39

The order object is already passed to the process() method so there's no need to use $this->getOrder() again.

Code: Select all

$basket = $this->getOrderBase($order->getBaseId(), \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL);
The getOrderBase() returns an object of this type:
https://github.com/aimeos/aimeos-core/b ... /Iface.php

You didn't say anything about your used Aimeos version so I assume you use 2020.04+
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply