I've done a bit of digging here on this topic and not come up with anything beyond a modification (which looks great) by AbleMods that is what I would call the super deluxe version of what I'm after.
I created a new status called 'Shipped + 7 Days' and an associated email to go along with it. It sends a note to the customer thanking them for their order, and saying 'by now you should have received your package, etc.'
I know I can't just have a scheduled job change the status in the database as that won't fire the trigger.
Is there any way programatically to update an order's status so that the trigger would be fired? I can't see adding this as a manual task - e.g. having someone log in, find the orders that shipped one week ago, changing their status.
Automated Status Change
Re: Automated Status Change
Simply call UpdateOrderStatus method on order object by providing it the order status id for your desired order status.
Also read following topic it can help you about custom timed events
http://wiki.ablecommerce.com/index.php/ ... med_Events
Code: Select all
order.UpdateOrderStatus(1);
http://wiki.ablecommerce.com/index.php/ ... med_Events
Re: Automated Status Change
Mazhar -
Thank you very much for the quick reply. I'm not terribly familar with the innerworkings of Able.
If I wanted to query the DB and pull out all order IDs where the shipping status had been set to shipped 7 days prior and then process those orders using the UpdateOrderStatus method, would that be possible? I'm comfortable pulling the data out, I'm just not sure how you would call the routine N times, where N was the number of order records that were returned by the query.
Thanks again,
Andy
Thank you very much for the quick reply. I'm not terribly familar with the innerworkings of Able.
If I wanted to query the DB and pull out all order IDs where the shipping status had been set to shipped 7 days prior and then process those orders using the UpdateOrderStatus method, would that be possible? I'm comfortable pulling the data out, I'm just not sure how you would call the routine N times, where N was the number of order records that were returned by the query.
Thanks again,
Andy
Re: Automated Status Change
It could be something like below, where orderStatusId will be the integer id assigned to your shipped 7 days prior status in ac_OrderStatuses table. Similarly newOrderStatusId will be order status id which you want to assign to your order. You can find this integer value by looking on ac_OrderStatuses table.
Code: Select all
OrderCollection orders = OrderDataSource.LoadForOrderStatus(orderStatusId);//load by order status id of "shipped 7 days prior"
//ITERATE ON ALL RETURNED ORDERS
foreach (Order order in orders)
{
//UPDATE ORDER STATUS OF EVERY ORDER TO NEW STATUS
order.UpdateOrderStatus(newOrderStatusId);
order.Save();
}