Correct way to integrate ERP system
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 44
- Joined: 05 Feb 2018, 09:57
Correct way to integrate ERP system
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.
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.
Re: Correct way to integrate ERP system
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.
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
-
- Posts: 44
- Joined: 05 Feb 2018, 09:57
Re: Correct way to integrate ERP system
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.
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.
Re: Correct way to integrate ERP system
You have to use $order->getBaseId() and pass the PARTS_PRODUCTS constant to retrieve the ordered products too:
https://aimeos.org/docs/Developers/Libr ... lete_order
https://aimeos.org/docs/Developers/Libr ... lete_order
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
-
- Posts: 44
- Joined: 05 Feb 2018, 09:57
Re: Correct way to integrate ERP system
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.
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.
Re: Correct way to integrate ERP system
Thanks, this has been fixed in the docs.
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