‘COMPLETED’ status when buy with wallet credit
-
When user buy credit for wallet (via credit card), the order finish with COMPLETED status. That’s correct. But, when user buy and pay something with his wallet credit, the order finish with PROCESSING status. How to change this automatically to COMPLETED? i’ve tried this code in my functions.php, but it does not work:
add_action(‘woo_wallet_payment_processed’, ‘woo_wallet_payment_processed_callback’, 10, 2);
if(!function_exists(‘woo_wallet_payment_processed_callback’)){
function woo_wallet_payment_processed_callback($order_id, $wallet_response){
if($wallet_response){
$order = wc_get_order($order_id);
$order->set_status(‘completed’);
}
}
}Thanks!
- The topic ‘‘COMPLETED’ status when buy with wallet credit’ is closed to new replies.