Developer forum

Forum » Ecommerce - Standard features » Set currency
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

I know it is possible to use ?CurrencyCode=EUR to set the currency, and it work as expected.

But is it so that it cant be used after a cart is created? I try to change the currency when I'm in the basket, and it looks like it is working, the currency is changed.
The problem appears after the order is paid and completed in DIBS. When redirected back I get a blank page, and in the EventViewer I see this error:

Unexpected exception GetContent() with the message: Attempt to aritmatic with two prices of different currency: NOK and  GBP with the amounts 0 and 1599. Dynamicweb.Ecommerce.Prices.PriceInfoCurrencyException: Attempt to aritmatic with two prices of different currency.

I also see this error on the same time:

Called State ok, but order is not set complete - this should have happened in the callback.

If I do not use the CurrencyCode querystring, or if I change currency before I add anything to the cart, there is no problem and the order is created.

This happens with DW 9.6.3 


Replies

 
Nicolai Pedersen
Reply

It should be possible to change after the cart have been created. But we have been chasing scenarios where this exception happens - we know that some situations like this can occur but cannot figure out what it is.

So if you can post the entire call stack and maybe a screen dump of the page on which you change the currency (checkout step) then it would be a help. Also if you can reproduce, I would love a sql dump of the order table and orderlines for the cart/order in question.

Thanks and sorry about the inconvenience.

Nicolai

 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Thanks, I have a site where this can be reproduced. I'll send you the details in an email ;)

 
Nicolai Pedersen
Reply

Phew - this is a hard one.

It seems like you do like this: ?CurrencyCode=USD&DeliveryCountry=CA and DeliveryCountry is your own parameter which gets saved into a cookie.

I think the issue is that the country on the context is not changed correctly - it is used to calculate the proper VAT - I also encountered issue when changing to DKK that VAT was missing until a couple of reloads.

When changing country, try to do this as well &CountryCode=CA and see if that will eliminate the error.

BR Nicolai

 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

Thanks Nicolai for looking into this.

Unfortunatly adding &CountryCode=XX did not solve anything, I also tried without the &DeliveryCountry=XX but no luck.
I created a support case on this issue too. We really need help to solve this, hope you can help us out.

/Martin

 

You must be logged in to post in the forum