You have no items in your shopping cart.

Friday, March 29, 2024 5:24:33 PM

Multilanguage message template

Posted: 3 years ago

#11428 Quote

stroka

Posted: 3 years 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

Posted: 3 years ago

#11430 Quote

Support

Posted: 3 years ago

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

Posted: 3 years ago

#11431 Quote

stroka

Posted: 3 years ago

#11431 Quote
We are using 4.10

Posted: 3 years ago

#11432 Quote

Support

Posted: 3 years 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 © 2023 FoxNetSoft. All rights reserved