Ubercart Order Complete
Categories
Component ID
1811256
Component name
Ubercart Order Complete
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Downloads
644
Component created
Component changed
Component body
This module provides the ability to perform actions when an order is marked 'completed'.
Out of the box, it provides two simple features:
1. It records the timestamp when an order's status is changed to 'completed'.
2. It provides two hooks allowing other modules to do stuff when an order's completion date is set/unset.
Completed timestamp
When an order's status is changed to 'completed', this module will store the current timestamp in the {uc_order_complete} table.
This timestamp is available on the $order object in $order->completed.
Hooks
Modules can act upon an order at the time of it's completion by invoking hook_uc_order_complete().
<?php
/**
* Act on orders when they are marked 'completed'.
*
* @param $order
* The order object.
*/
function hook_uc_order_complete($order) {
// Do stuff...
}
?>
They can also act upon an order if the status is changed FROM 'completed' to something else, by invoking hook_uc_order_uncomplete().
<?php
/**
* Act on orders when they are changed from 'completed' to something else.
*
* @param $order
* The order object.
*/
function hook_uc_order_uncomplete($order) {
// Do stuff...
}
?>
