• Resolved espinozar1994

    (@espinozar1994)


    The default woocommerce currency I have for products is USD. I configured the plugin for Colombia to show and work with COP, and in the rest of the world with USD.

    I have two payment methods, Colombian payment method (Payu) and Paypal, everything works perfect but when I try to pay with Paypal in Colombia it sends the currency as COP and I need it to be sent as USD at that moment, that is, Paypal omit your plugin settings.

    I tried doing this:

    function wpcc_change_currency($paypal_args)
    {
    if ($paypal_args['currency_code'] == 'COP') {
        $convert_rate = 3666; //set the converting rate
        $paypal_args['currency_code'] = 'USD'; //change Pen to USD
        $i = 1;
    
        while (isset($paypal_args['amount_' . $i])) {
            $paypal_args['amount_' . $i] = round($paypal_args['amount_' . $i] / $convert_rate, 2);
            ++$i;
        }
    
        if (isset($paypal_args['tax_cart'])) {
            $paypal_args['tax_cart'] = round($paypal_args['tax_cart'] / $convert_rate, 2);
        }
    
        if (isset($paypal_args['shipping_1'])) {
            $paypal_args['shipping_1'] = round($paypal_args['shipping_1'] / $convert_rate, 2);
        }
    
        if ($paypal_args['discount_amount_cart'] > 0) {
            $paypal_args['discount_amount_cart'] = round($paypal_args['discount_amount_cart'] / $convert_rate, 2);
        }
    }
    return $paypal_args;
    }

    But it doesn’t work, that code doesn’t really change anything, is there a way to configure the plugin so that it doesn’t affect paypal? I need PayPal to always work with USD and default prices.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Problems with Paypal’ is closed to new replies.