MessageTokenProvider does not use the languageId parameter

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 Jahre weitere
In nopCommerce 2.1 in the MessageTokenProvider class, there is a method:
protected virtual string ProductListToHtmlTable(Order order, int languageId)


But a bit lower  there is one line of code:

if (!String.IsNullOrEmpty(opv.ProductVariant.GetLocalized(x => x.Name)))


This in turn will try to get the languageId from the work context. In my case, this is a task and the context is a "fake context", which will cause a lot of notimplementedexceptions...
12 Jahre weitere
You're absolutely right. Fixed. Thanks!
12 Jahre weitere
Great, thanks!

Found a few of the same bug a bit lower down in the same method as well
12 Jahre weitere
The same goes for line 289, 299 and 305 as well but with this line instead:

_priceFormatter.FormatPrice(orderTaxInCustomerCurrency, true, order.CustomerCurrencyCode, false);


Which should be:

_priceFormatter.FormatPrice(orderTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, false);
12 Jahre weitere
Thanks! In the first method you pass 'false' for 'showTax' parameter. But in the second one you pass it for 'priceIncludeTax' param.
12 Jahre weitere
a.m. wrote:
Thanks! In the first method you pass 'false' for 'showTax' parameter. But in the second one you pass it for 'priceIncludeTax' param.


Oh, youre right. How should I write it then? Should it be true or false?
12 Jahre weitere
You should pass both 'priceIncludeTax' and 'showTax' parameters. Look at PriceFormatter implementation in order to know how to get the current 'priceIncludeTax' parameter
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.