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 years ago
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 years ago
You're absolutely right. Fixed. Thanks!
12 years ago
Great, thanks!

Found a few of the same bug a bit lower down in the same method as well
12 years ago
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 years ago
Thanks! In the first method you pass 'false' for 'showTax' parameter. But in the second one you pass it for 'priceIncludeTax' param.
12 years ago
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 years ago
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.