Horje
order status automatically changes from “On hold” to “processing” Code Example
order status automatically changes from “On hold” to “processing”
add_action('woocommerce_order_status_changed', 'ts_auto_complete_by_payment_method');

function ts_auto_complete_by_payment_method($order_id)
{

if ( ! $order_id ) {
return;
}

global $product;
$order = wc_get_order( $order_id );

if ($order->data['status'] == 'on-hold') {
$payment_method=$order->get_payment_method();
if ($payment_method!="COD")  // change payment method 
{
$order->update_status( 'processing' );
}}}
order status automatically changes from “On hold” to “processing”
add_action( 'woocommerce_thankyou', 'woocommerce_auto_processing_orders');
function woocommerce_auto_processing_orders( $order_id ) {
    if ( ! $order_id )
        return;

    $order = wc_get_order( $order_id );

    // If order is "on-hold" update status to "processing"
    if( $order->has_status( 'on-hold' ) ) {
        $order->update_status( 'processing' );
    }
}




Whatever

Related
parser Code Example parser Code Example
phpmyadmin timedeconnexion : a placer tt en bas dans "config.inc.php" Code Example phpmyadmin timedeconnexion : a placer tt en bas dans "config.inc.php" Code Example
roblox button visible outside of scrolling frame Code Example roblox button visible outside of scrolling frame Code Example
keycloak https enable Code Example keycloak https enable Code Example
top 5 majors Code Example top 5 majors Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10