You have no items in your shopping cart.

Saturday, May 8, 2021 3:41:59 AM

Multilanguage message template

Avatar

Posted: one month ago

#11428 Quote

stroka

Posted: one month ago

#11428 Quote
Hi,

We are using Newsletter Subscription plugin for sending discount coupons when customer activate newsletter subscription but we have problems with multilanuage tempaltes.
Our configuration - multilanguage:
Store1: domain.com (languages: English / Italian). default language = English.
If customer change language to italian and subscribe to newsletter he gets message in italian language, but after newsletter activation he gets message in englisg language (not italian).

It's look like that you get languageId from store (defaultStore language id). Is possible to get languageid from workContext? _workContext.WorkingLanguage.Id;

Best regards
Avatar

Posted: one month ago

#11430 Quote

Support

Posted: one month ago

#11430 Quote
What nop version do you use?
I checked the code and the plugin reads languageID  from customer session.
Avatar

Posted: one month ago

#11431 Quote

stroka

Posted: one month ago

#11431 Quote
We are using 4.10
Avatar

Posted: one month ago

#11432 Quote

Support

Posted: one month ago

#11432 Quote
I use this code

                var languageId = store.DefaultLanguageId;
                var customer = customerService.GetCustomerByEmail(subscription.Email);
                if (customer != null)
                    languageId = genericAttributeService.GetAttribute<int>(customer, NopCustomerDefaults.LanguageIdAttribute, subscription.StoreId);


Do you use the last release of the plugin?

Powered by nopCommerce

Copyright © 2019 FoxNetSoft. All rights reserved