Skip to content

Commit 06e9171

Browse files
committed
Redirect to the home page instead of the StoreClosed page when the store is no longer closed
1 parent d3ad767 commit 06e9171

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Presentation/SmartStore.Web/Controllers/HomeController.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Web.Mvc;
3+
using SmartStore.Core.Domain;
34
using SmartStore.Core.Domain.Common;
45
using SmartStore.Core.Domain.Customers;
56
using SmartStore.Core.Domain.Seo;
@@ -23,19 +24,22 @@ public partial class HomeController : PublicControllerBase
2324
private readonly Lazy<CommonSettings> _commonSettings;
2425
private readonly Lazy<PrivacySettings> _privacySettings;
2526
private readonly Lazy<HomePageSettings> _homePageSettings;
27+
private readonly Lazy<StoreInformationSettings> _storeInformationSettings;
2628

2729
public HomeController(
2830
Lazy<ITopicService> topicService,
2931
Lazy<CaptchaSettings> captchaSettings,
3032
Lazy<CommonSettings> commonSettings,
3133
Lazy<PrivacySettings> privacySettings,
32-
Lazy<HomePageSettings> homePageSettings)
34+
Lazy<HomePageSettings> homePageSettings,
35+
Lazy<StoreInformationSettings> storeInformationSettings)
3336
{
3437
_topicService = topicService;
3538
_captchaSettings = captchaSettings;
3639
_commonSettings = commonSettings;
3740
_privacySettings = privacySettings;
3841
_homePageSettings = homePageSettings;
42+
_storeInformationSettings = storeInformationSettings;
3943
}
4044

4145
[RewriteUrl(SslRequirement.No)]
@@ -51,6 +55,11 @@ public ActionResult Index()
5155

5256
public ActionResult StoreClosed()
5357
{
58+
if (!_storeInformationSettings.Value.StoreClosed)
59+
{
60+
return RedirectToRoute("HomePage");
61+
}
62+
5463
return View();
5564
}
5665

0 commit comments

Comments
 (0)