The best way to send the order data along with the order id right after the order placement
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!
The best way to send the order data along with the order id right after the order placement
Hi!
Could you please give me a tip what is the best way to send an order data (to third party ERP system) along with the order id right after the order placement?
I guess I can't do this via a new basket plugin since there is no order id on this step yet (autoincrement).
Also it seems there is no hook like setOrder.after.
And also doing this with a new cronjob seems to be a little bit overkill.
Thanks!
Laravel 6.20.27
aimeos/aimeos-core 2020.10.24
PHP 7.4
Could you please give me a tip what is the best way to send an order data (to third party ERP system) along with the order id right after the order placement?
I guess I can't do this via a new basket plugin since there is no order id on this step yet (autoincrement).
Also it seems there is no hook like setOrder.after.
And also doing this with a new cronjob seems to be a little bit overkill.
Thanks!
Laravel 6.20.27
aimeos/aimeos-core 2020.10.24
PHP 7.4
Re: The best way to send the order data along with the order id right after the order placement
Doing this immediately after the order is placed (resp. when the payment gateway reports that the payment is OK) is usually a bad idea but this can happen more than once. The solution in Aimeos is to create a delivery service provider (or service decorator) which sends the order data to the ERP system in it's processBatch() (preferred) or process() methods:
- https://aimeos.org/docs/latest/provider ... /delivery/
- https://aimeos.org/docs/latest/provider ... ecorators/
These methods are automatically called if the order/service/delivery job is called by a cronjob:
https://aimeos.org/docs/latest/laravel/ ... ery-minute
- https://aimeos.org/docs/latest/provider ... /delivery/
- https://aimeos.org/docs/latest/provider ... ecorators/
These methods are automatically called if the order/service/delivery job is called by a cronjob:
https://aimeos.org/docs/latest/laravel/ ... ery-minute
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
Re: The best way to send the order data along with the order id right after the order placement
Thanks for the reply!
...so if I have several delivery options my steps to implement this are:
1. to create a new decorator with the processBatch method implemented.
2. to add this decorator to every delivery option in my admin backend
Questions:
1. Having this, the processBatch method will be executed automatically (by the cron job) every time, when delivery status of some order has changed, correct? I just can't understand what orders will be processed every time when job runs: all the last orders or I have to point out somehow what order to process?
2. So this is for delivery statuses only, all payment statuses changes will be ignored, correct?
...so if I have several delivery options my steps to implement this are:
1. to create a new decorator with the processBatch method implemented.
2. to add this decorator to every delivery option in my admin backend
Questions:
1. Having this, the processBatch method will be executed automatically (by the cron job) every time, when delivery status of some order has changed, correct? I just can't understand what orders will be processed every time when job runs: all the last orders or I have to point out somehow what order to process?
2. So this is for delivery statuses only, all payment statuses changes will be ignored, correct?
Re: The best way to send the order data along with the order id right after the order placement
Yes
These are the used conditions for selecting orders to call the processBatch() method for:akropivko wrote: ↑16 Jun 2021, 10:08 1. Having this, the processBatch method will be executed automatically (by the cron job) every time, when delivery status of some order has changed, correct? I just can't understand what orders will be processed every time when job runs: all the last orders or I have to point out somehow what order to process?
https://github.com/aimeos/ai-controller ... #L111-L115
Yes
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