Setting Delivery Status on Error during Processing

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!
User avatar
MattWoodward
Posts: 20
Joined: 03 Mar 2022, 04:15

Setting Delivery Status on Error during Processing

Post by MattWoodward » 30 Mar 2022, 02:35

I have implemented a custom Delivery Provider. When the process() routine is called, and an error occurs, I want to be able to set the delivery status to a value that will ensure the order is re-processed when the cron job runs next (so it is not missed).

In the docs it says to use a value of: STAT_UNFINISHED. However if I use this value, the order is not reprocessed (and my Delivery provider process() routine re-called).

I've noticed that manually doing this through the Admin UI I have to set the status for both the order products and the invoice delivery statuses to the "(empty / blank)" value in the drop down menu for the order to be reprocessed. Using the "Unfinished" menu option does not allow the order to be reprocessed.

Which delivery status is equivalent to the empty / blank option used in the Admin UI? I can see this value is essentially empty / null in the select list.

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

Re: Setting Delivery Status on Error during Processing

Post by aimeos » 30 Mar 2022, 16:54

If you set the delivery status of the order to NULL, it will be processed again:
https://github.com/aimeos/ai-controller ... d.php#L114

FYI: The NULL value has several disadvantages and we've changed that back to STAT_UNFINISHED in 2022.x
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
MattWoodward
Posts: 20
Joined: 03 Mar 2022, 04:15

Re: Setting Delivery Status on Error during Processing

Post by MattWoodward » 01 Apr 2022, 04:00

Thank you! I have tested that and can see it working as I'd expected now.

I'd have no objection using STAT_UNFINISHED if it would allow me to re-process, but at this point it doesn't sadly. It feels like it should though?

What are the disadvantages you mentioned?

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

Re: Setting Delivery Status on Error during Processing

Post by aimeos » 01 Apr 2022, 12:22

For example, you can't search for orders in the admin backend if the status is NULL.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply