@moeinmr For this please use the attached code in the theme functions.php file.
add_filter('woocommerce_payment_complete_order_status', 'woocommerce_payment_complete_order_status_callback', 10, 2);
if(!function_exists('woocommerce_payment_complete_order_status_callback')){
function woocommerce_payment_complete_order_status_callback($status, $order_id){
$order = wc_get_order($order_id);
if('wallet' === $order->get_payment_method('edit')){
$status = 'completed';
}
return $status;
}
}
@moeinmr it should work. Please make sure you put the code in right place.
I put it in the right place but it does not work
@moeinmr We tested the code and it is working for us.
Anyway, I tried this code many times and it did not work
@moeinmr Please try this code.
add_action('woo_wallet_payment_processed', 'woo_wallet_payment_processed_callback');
if(!function_exists('woo_wallet_payment_processed_callback')){
function woo_wallet_payment_processed_callback($order_id){
$order = wc_get_order($order_id);
$order->set_status('completed');
$order->save();
}
}
@moeinmr It might be your site issue. Please contact with your developer regarding this.
There is no problem with the site because I have 3 different sites and your code does not apply to any of them