How to configure and adapt Aimeos based shops as developer
Forum rules: Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#6028 by michal.fehér
12 Apr 2018, 15:01
Hi. According to documentation, the correct way how and where to integrate an ERP system is via Service providers (https://aimeos.org/docs/Developers/Library/Service).

But docs only mention delivery and payment providers. Our case is following: We want to push new order into our ERP system immediately when the order is placed. We dont want to wait until the order is shipped or paid.
What would be the best thing to do? Create new Service provider (similar to one of the existing delivery/payment service provider) and create a new cron job to trigger this service provider, or somehow utilize the delivery provider to be triggered immediately when the order is placed?

First, I thought the basket plugin will be best for this scenario, but after I read docs it looks the service providers is better place where to store this logic - and I can leverage the cron jobs.

Thanks.
#6034 by aimeos
13 Apr 2018, 17:37
Yes, implement a delivery service provider for this. Then you can push orders by cronjob every minute but you need some kind of payment provider that sets the payment status to authorized, even if it's doesn't do anything else. The "PostPay" provider does this for example.
#6046 by michal.fehér
18 Apr 2018, 08:40
Thanks for the tip.

So I am creating a new delivery provider. In process method I accept \Aimeos\MShop\Order\Item\Iface $order.

How can I get products from this $order object? This returns empty array:
$this->getOrderBase($order->getId())->getProducts()

In DB everything looks correct.

Thanks.
#6056 by michal.fehér
19 Apr 2018, 11:42
Works now, thank you.

I had to use
\Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT
instead of
\Aimeos\MShop\Order\Manager\Base\Base::PARTS_PRODUCT
as it was mentioned in docs. Not sure if docs are not corrent, but PARTS_PRODUCT wasnt found in Order\Manager\Base.