@subratamal Update : sorry, I need to change the status to “wallet-recharge” of wallet top up order. I have already created custom “wallet-recharge” status. I tried this below code, but the wallet top is not showing in the wallet. So I guess it first needs to be marked as completed and then changed to “wallet-recharge”. Your help would be appreciated.
Here’s the code I tried –
add_filter('woocommerce_payment_complete_order_status', 'woocommerce_payment_complete_order_status_callback', 10, 3);
if (!function_exists('woocommerce_payment_complete_order_status_callback')) {
function woocommerce_payment_complete_order_status_callback($status, $order_id, $order) {
if (is_wallet_rechargeable_order($order)) {
$status = 'wallet-recharge';
}
return $status;
}
}