Jump to content

PayPal Currency Conversion not working for gift wrapping cost


Recommended Posts

PayPal express checkout and pay with credit card methods have a strange issue with gift wrapping costs

The store has 4 currencies, all the values in the cart are getting converted correctly except the gift wrapping price.

Did anyone encounter this issue?

PayPal didn't set the "covertPrice" method's parameter convert to true.

public function formatPrice($price)
    {
        $context = Context::getContext();
        $context_currency = $context->currency;
        $paypal = Module::getInstanceByName('paypal');
        if ($paypal->needConvert()) {
            $price = Tools::convertPrice($price, $context_currency, false);
        }
        $price = number_format($price, Paypal::getDecimal(), ".", '');
        return $price;
    }

If I change it to true, that converts the currency value to selected currency, I get error code 0 the last step of checkout. 

Link to comment
Share on other sites

  • 1 year later...

I changed a line of code  in a file modules/paypal/classes/MethodEC.php as below to get a hot fix.

I replaced            

$wrapping_price = $this->formatPrice($wrapping_price);

with 

$wrapping_price = $this->formatPrice($wrapping_price*0.009524); where the value 0.009524 is the exchange rate ratio.
 

Edited by bipeen (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...