Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Attempt to aritmatic with two prices of different currency

Attempt to aritmatic with two prices of different currency

Kevin O'Driscoll
Reply

After upgrade to 9.5 fixed all tags and any API were using. When we add to Cart we get the following error:

Exception Details: Dynamicweb.Ecommerce.Prices.PriceInfoCurrencyException: Attempt to aritmatic with two prices of different currency
Stack Trace: 
[PriceInfoCurrencyException: Attempt to aritmatic with two prices of different currency]
   Dynamicweb.Ecommerce.Prices.PriceInfo.Add(IPriceInfo info) +961
   Dynamicweb.Ecommerce.Prices.PriceInfo.Add(IPriceReferenceInfo info) +29
   Dynamicweb.Ecommerce.Orders.OrderLineCollection.get_Price() +321
   Dynamicweb.Ecommerce.Orders.Order.GetPriceBeforeFees(Boolean negativePriceControl) +48
   Dynamicweb.Ecommerce.Orders.Discounts.DiscountProvider.IsDiscountForOrder(Order order, Discount orderDiscount, OrderLine orderline) +797
   Dynamicweb.Ecommerce.Orders.Discounts.DiscountProvider.ProcessInclusiveDiscounts(Order order) +366
   Dynamicweb.Ecommerce.Orders.OrderService.CalculateDiscounts(Order order) +3925
   Dynamicweb.Ecommerce.Cart.Frontend.HandleDiscountAndTaxes(Order cart, Boolean fromBackend) +57
   Dynamicweb.Ecommerce.Frontend.Cart.CartPageTemplateExtender.ExtendTemplate(Template template) +180
   Dynamicweb.Frontend.Renderer.RenderPageTemplateExtenders(Template Template) +794
   Dynamicweb.Frontend.Renderer.RenderPage(Template template, PageViewModel pageViewModel) +6227
   Dynamicweb.Frontend.PageView.SetPageTemplateValues() +220
   Dynamicweb.Frontend.PageView.Output() +1170
   Dynamicweb.Frontend.DynamicwebHttpHandler.ProcessRequest(HttpContext context) +221
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +790
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88

This is one website with Ecom settings set to English and currency settings set to GBP

When we check the Template Tags GetString("Ecom:Product.Price.Currency.Code") the value is USD and GetString("Ecom:Product.Price.Currency") value US DOLLARS

We dont find any references setting the currency to US in any configs and the Area settings in the database look ok

All pricing is excluding VAT, we have no VAT groups set in DW and we have the VAT set in system VAT on the Prices

Any ideas why we get this error?

Also wehen the error occurs the browser is captured (like a cookie is set??) and we have to clear all history and close the browser before the error is cleared. This is a really weird behavior??

Kev

 


Replies

 
Nicolai Pedersen
Reply

Hi Kevin

Yes, anoying message. What exact version are you using?

The problem could arise from the user you login with - the user has an old cart associated in a different currency giving this error or it could be that the user has a currency related to him/her that is the USD one.

Try this SQL on the database: select OrderID, OrderCurrencyCode from ecomorders where [OrderCustomerAccessUserID] = 1
Change the 1 to accessuserid of the user you are currently logged in with.

select OrderID, OrderCurrencyCode from ecomorders where [OrderCurrencyCode ] <> 'GBP'

If this does not provide information, please provide a link so we can have a look.

BR Nicolai

 
Kevin O'Driscoll
Reply
9.5.0.0
Dynamicweb.Admin.dll 9.5.1
Dynamicweb.Admin, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null
Build date Mon, 24 Sep 2018 15:43
 
The user is annonymous at this stage not logged-in. Your scripts revealed the order was saved but no orderlines. We use only GBP and EUR currencies and I really dont know where the US reference is coming from and I think this is the issue.
You will remember this project as Dimitri did some custom work for this in 2016. The cart is computed remotely but the error occurs in DW before the remote call is made.
 
Nicolai Pedersen
Reply

Hi Kevin

Do you have discounts that has a wrong currecny code maybe?

I cannot log in to the solution using med credentials. Could you please provide adminstrator login to the solution? By email probably :-)

 

You must be logged in to post in the forum