• Resolved dgenc

    (@dgenc)


    Hi, im use charge system extention name: WooCommerce Pay for Payment

    I set credit cart payments % 5 charged

    Example customer buy item 100 usd , if pay credit cart system automatic add + 5 usd total 105 usd.

    Wallet system, customer add 100 usd wallet, and pay credit cart 105.

    But add balance 105 usd. How i set?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    Hi @dgenc,

    Thanks for reaching out to our support forum. Please use below code snippet to your themes function.php file. It will add 100 USD instead of 105. Before that please make sure you have updated to latest version of our plugin.

    add_filter('woo_wallet_credit_purchase_amount', 'woo_wallet_credit_purchase_amount_callback', 10, 2);
    
    function woo_wallet_credit_purchase_amount_callback($recharge_amount, $order_id) {
        $order = wc_get_order($order_id);
        $recharge_amount = $order->get_subtotal('edit');
        if ('on' === woo_wallet()->settings_api->get_option('is_enable_gateway_charge', '_wallet_settings_credit', 'off')) {
            $charge_amount = woo_wallet()->settings_api->get_option($order->get_payment_method(), '_wallet_settings_credit', 0);
            if ('percent' === woo_wallet()->settings_api->get_option('is_enable_gateway_charge', '_wallet_settings_credit', 'percent')) {
                $recharge_amount -= $recharge_amount * ($charge_amount / 100);
            } else {
                $recharge_amount -= $charge_amount;
            }
            update_post_meta($order_id, '_wc_wallet_purchase_gateway_charge', $charge_amount);
        }
        return $recharge_amount;
    }

    Thank you.

    Thread Starter dgenc

    (@dgenc)

    Super! Thank you. Work

    Plugin Author Subrata Mal

    (@subratamal)

    @dgenc,
    Happy to hear from you that above code works for you.

    I am marking this topic as resolved please feel free to create a new thread for any further assistance.

    Could you please consider posting a review of our plugin? In addition to providing feedback, reviews can help other users to know who we are and what our plugin does.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Charge Problem’ is closed to new replies.