@krystianrzepa Please use the attached code in theme functions.php file.
add_filter('woo_wallet_credit_purchase_amount', 'woo_wallet_credit_purchase_amount_callback', 10, 2);
if(!function_exists('woo_wallet_credit_purchase_amount_callback')) {
function woo_wallet_credit_purchase_amount_callback($amount, $order_id) {
$order = wc_get_order($order);
$amount = $order->get_total('edit');
return $amount;
}
}
@subratamal Your code isn’t working. I get below error and I don’t get topup to wallet:
PHP Fatal error: Uncaught Error: Call to a member function get_total() on bool in //file_location// eval()’d code:73
@krystianrzepa Sorry please use the updated code.
add_filter('woo_wallet_credit_purchase_amount', 'woo_wallet_credit_purchase_amount_callback', 10, 2);
if(!function_exists('woo_wallet_credit_purchase_amount_callback')) {
function woo_wallet_credit_purchase_amount_callback($amount, $order_id) {
$order = wc_get_order($order_id);
$amount = $order->get_total('edit');
return $amount;
}
}
@subratamal Many thanks! 🙂 Now everything is fine.