I am using the Drupal 7 Commerce module. I would like to execute a special code when the payment of the order is completed.
What is the difference between checkout complete and complete?
I googled and I found suggestions for these hook implementations.
First option
function mymodule_commerce_order_update($order) {
if ($order->status == 'completed' ) {
// ...
}
}
Second option
function my_module_commerce_order_presave($order) {
if ($order->status == 'completed' ) {
// ...
}
}
###Third option
I found some suggestions to implement hook_commerce_order_updated()
.
Fourth option
function mymodule_commerce_checkout_complete($order) {
if ($order->status == 'completed' ) {
// ...
}
}