Search
 
SCRIPT & CODE EXAMPLE
 

PHP

put woocommerce orders on pending payment automatically

add_action( 'woocommerce_thankyou', 'woocommerce_thankyou_change_order_status', 10, 1 );
function woocommerce_thankyou_change_order_status( $order_id ){
    if( ! $order_id ) return;

    $order = wc_get_order( $order_id );

    if( $order->get_status() == 'processing' )
        $order->update_status( 'pending' );
}
Comment

PREVIOUS NEXT
Code Example
Php :: include() in php 
Php :: php check valid json string 
Php :: convert_uudecode (PHP 5, PHP 7, PHP 8) convert_uudecode — Decode a uuencoded string 
Php :: add javascript to functions.php 
Php :: wordpress is_tag function 
Php :: what does defined di in php 
Php :: @foreac laravel 
Php :: contact form 7 checkbox2 
Php :: export to excel in php 
Php :: set custome table laravel eloquent 
Php :: distinct laravel not working 
Php :: laravel Please provide a valid cache path 
Php :: wordpress get product category name by termid 
Php :: drupal 7 hook_node_update 
Php :: get filesize php 
Php :: if function not exists php 
Php :: route laravel Target class [AuthController] does not exist 
Php :: PHP MySQL Use The WHERE Clause 
Php :: laravel response json status 500 
Php :: curl error (code 3) url malformed laravel 
Php :: php move element to beginning of array 
Php :: laravel relationship search 
Php :: laravel all fillable 
Php :: leftJoinSub laravel 
Php :: IlluminateContractsAuthAuthenticatable, AppModelsUser given, called in 
Php :: how to include javascript in php 
Php :: text box should accept only alphanumeric not special characters in php 
Php :: how hide empty category wordpress woocommerce 
Php :: laravel model::query 
Php :: add month to date 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =