federated-wordpress-customi.../woocommerce/processing_to_complete_order.php

16 lines
358 B
PHP
Raw Permalink Normal View History

<?php
2024-10-17 20:39:34 +00:00
if( ! defined( 'ABSPATH' ) ){
exit; // Exit if accessed directly.
}
add_action('woocommerce_payment_complete', 'federated_set_new_order_to_complete');
function federated_set_new_order_to_complete($order_id)
{
$order = wc_get_order($order_id);
if($order->has_status('processing')){
$order->update_status('completed');
}
}