VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: betterlead on June 11, 2013, 10:41:11 AM

Title: Warning: Division by zero...
Post by: betterlead on June 11, 2013, 10:41:11 AM
I need help on this one. What does this message mean? It pops up in my Klarna one page checkout cart. See screen shot below. The code in the file (197 starts with  $tax_rate = $cart->)
if (isset($cart->pricesUnformatted ['shipmentValue'])) {
            $price = $paymentCurrency->convertCurrencyTo(
                $method->payment_currency,
                $cart->pricesUnformatted ['shipmentValue'] + $cart->pricesUnformatted['shipmentTax'],
                FALSE
            );
            $tax_rate = $cart->pricesUnformatted['shipmentTax'] / ($cart->pricesUnformatted['shipmentValue'] - $cart->pricesUnformatted['shipmentTax']) * 100;
            $name = JText::sprintf ('VMPAYMENT_KLARNA_CHECKOUT_ONEPAGE_SHIPPING', strip_tags($cart->cartData['shipmentName']));
            $korder['cart']['items'][] = array(
                'reference'     => 'shipping',
                'name'          => substr($name, 0, 127),
                'quantity'      => 1,
                'unit_price'    => $this->formatCurrency($price),
                'discount_rate' => $this->formatCurrency(0),
                'tax_rate'      => $this->formatCurrency($tax_rate)
            );
        }



[attachment cleanup by admin]
Title: Re: Warning: Division by zero...
Post by: alatak on June 11, 2013, 11:08:50 AM
Hello
The klarna payment you are using, is not the one provided in the core.
So i cannot help you.

May be you can contact the developer
Title: Re: Warning: Division by zero...
Post by: betterlead on June 11, 2013, 11:33:27 AM
Well no, it's the new Klarna One page checkout, I know. But the code / error don't tell anybody what it might be?
Title: Re: Warning: Division by zero...
Post by: alatak on June 12, 2013, 13:25:33 PM
Hello

Quote, it's the new Klarna One page checkout
Where did you get that from?
Title: Re: Warning: Division by zero...
Post by: betterlead on June 13, 2013, 11:38:47 AM
From Klarna and a company that installs it for free on VM2. Klarna certified developer. Or whatever it's called. "Me novice" ;)
Title: Re: Warning: Division by zero...
Post by: Klarna Integration on June 18, 2013, 13:46:38 PM
Hi!

Have you managed to get past this?
Any progress?

For us to be able to help you further, it would be great if you could supply us with some more info regarding the matter.

Do you get any more specific error codes?

If you need any more feedback or questions, feel free to send an email straight to integration@klarna.com

Kind regards
Klarna integration.