Hi.
I have a project with liveintegration til NAV.
We are using v 1.0.0.6 of the sample code provided by DW, and have made a few minor changes to the code to request to NAV, to get and set the right data.
The site have 2 languages and 3 currencies
I should be posible on either language to switch between the different currencies.
As long as the Cart is empty it works as expected, but when ever there is anything in the cart the application throws an exeption:
[PriceInfoCurrencyException: Attempt to aritmatic with two prices of different currency]
Dynamicweb.Ecommerce.Prices.PriceInfo.Add(IPriceInfo info) +708
Dynamicweb.Ecommerce.Prices.PriceInfo.Add(IPriceReferenceInfo info) +21
Dynamicweb.Ecommerce.Orders.OrderLineCollection.get_Price() +241
Dynamicweb.Ecommerce.Orders.Order.GetPriceBeforeFees(Boolean negativePriceControl) +41
Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrderDetails(Template template, Order order, Boolean extendedProperties, OrderTemplateExtenderContext orderContext) +4730
Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrder(Order order, Template template, Boolean extendedProperties, Int32 stepNumber, OrderTemplateExtenderContext orderContext) +70
Dynamicweb.Ecommerce.Frontend.Cart.CartPageTemplateExtender.ExtendTemplate(Template template) +175
Dynamicweb.Frontend.Renderer.RenderPageTemplateExtenders(Template Template) +639
Dynamicweb.Frontend.Renderer.RenderPage(Template template, PageViewModel pageViewModel) +2904
Dynamicweb.Frontend.PageView.SetPageTemplateValues() +143
Dynamicweb.Frontend.PageView.Output() +777
Dynamicweb.Frontend.DynamicwebHttpHandler.ProcessRequest(HttpContext context) +141
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +813
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +132
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73
The exeption is thrown somewhere after the Page.Loaded notification, as i can debug until then.
I force the exeption to happen by inserting the CurrencyCode=XXX in the querystring
If i inspect the Dynamicweb.Ecommerce.Common.Context.Currency it is set to the right Currency eg. DKK, EUR or GBP.
None of the other code in the live-integration project is no excecuted so i cant do anything, like clearing cached prices and setting the currency for the order or orderlines.
It seems like there is something earlier in the pipeline where the cart is calculated. Is there a notification i can use to clear the calculation ?
the site is http://rocopenhagen.staging.dynamicweb-cms.com/ DW version 9.4.18.
Locally i have a DW version 9.5.6 giving the same exeption.
Any help would be much appriciated.
Thanks
//Kenneth