Skip to content

Commit

Permalink
#1672 "Check / Money Order" plugin didn't use description overridden …
Browse files Browse the repository at this point in the history
…per store
  • Loading branch information
AndreiMaz committed Sep 1, 2016
1 parent 527e65d commit d222e00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Expand Up @@ -126,11 +126,12 @@ public static class LocalizationExtensions
/// <param name="settings">Settings</param>
/// <param name="keySelector">Key selector</param>
/// <param name="languageId">Language identifier</param>
/// <param name="storeId">Store identifier</param>
/// <param name="returnDefaultValue">A value indicating whether to return default value (if localized is not found)</param>
/// <param name="ensureTwoPublishedLanguages">A value indicating whether to ensure that we have at least two published languages; otherwise, load only default value</param>
/// <returns>Localized property</returns>
public static string GetLocalizedSetting<T>(this T settings,
Expression<Func<T, string>> keySelector, int languageId,
Expression<Func<T, string>> keySelector, int languageId, int storeId,
bool returnDefaultValue = true, bool ensureTwoPublishedLanguages = true)
where T : ISettings, new()
{
Expand All @@ -139,7 +140,7 @@ public static class LocalizationExtensions
string key = settings.GetSettingKey(keySelector);

//we do not support localized settings per store (overridden store settings)
var setting = settingService.GetSetting(key, storeId: 0, loadSharedValueIfNotFound: false);
var setting = settingService.GetSetting(key, storeId: storeId, loadSharedValueIfNotFound: true);
if (setting == null)
return null;

Expand Down
Expand Up @@ -47,7 +47,7 @@ public ActionResult Configure()
//locales
AddLocales(_languageService, model.Locales, (locale, languageId) =>
{
locale.DescriptionText = checkMoneyOrderPaymentSettings.GetLocalizedSetting(x => x.DescriptionText, languageId, false, false);
locale.DescriptionText = checkMoneyOrderPaymentSettings.GetLocalizedSetting(x => x.DescriptionText, languageId, 0, false, false);
});
model.AdditionalFee = checkMoneyOrderPaymentSettings.AdditionalFee;
model.AdditionalFeePercentage = checkMoneyOrderPaymentSettings.AdditionalFeePercentage;
Expand Down Expand Up @@ -114,7 +114,7 @@ public ActionResult PaymentInfo()

var model = new PaymentInfoModel
{
DescriptionText = checkMoneyOrderPaymentSettings.GetLocalizedSetting(x => x.DescriptionText, _workContext.WorkingLanguage.Id)
DescriptionText = checkMoneyOrderPaymentSettings.GetLocalizedSetting(x => x.DescriptionText, _workContext.WorkingLanguage.Id, _storeContext.CurrentStore.Id)
};

return View("~/Plugins/Payments.CheckMoneyOrder/Views/PaymentCheckMoneyOrder/PaymentInfo.cshtml", model);
Expand Down

0 comments on commit d222e00

Please sign in to comment.