1
1
using System ;
2
2
using System . Web . Mvc ;
3
+ using SmartStore . Core . Domain ;
3
4
using SmartStore . Core . Domain . Common ;
4
5
using SmartStore . Core . Domain . Customers ;
5
6
using SmartStore . Core . Domain . Seo ;
@@ -23,19 +24,22 @@ public partial class HomeController : PublicControllerBase
23
24
private readonly Lazy < CommonSettings > _commonSettings ;
24
25
private readonly Lazy < PrivacySettings > _privacySettings ;
25
26
private readonly Lazy < HomePageSettings > _homePageSettings ;
27
+ private readonly Lazy < StoreInformationSettings > _storeInformationSettings ;
26
28
27
29
public HomeController (
28
30
Lazy < ITopicService > topicService ,
29
31
Lazy < CaptchaSettings > captchaSettings ,
30
32
Lazy < CommonSettings > commonSettings ,
31
33
Lazy < PrivacySettings > privacySettings ,
32
- Lazy < HomePageSettings > homePageSettings )
34
+ Lazy < HomePageSettings > homePageSettings ,
35
+ Lazy < StoreInformationSettings > storeInformationSettings )
33
36
{
34
37
_topicService = topicService ;
35
38
_captchaSettings = captchaSettings ;
36
39
_commonSettings = commonSettings ;
37
40
_privacySettings = privacySettings ;
38
41
_homePageSettings = homePageSettings ;
42
+ _storeInformationSettings = storeInformationSettings ;
39
43
}
40
44
41
45
[ RewriteUrl ( SslRequirement . No ) ]
@@ -51,6 +55,11 @@ public ActionResult Index()
51
55
52
56
public ActionResult StoreClosed ( )
53
57
{
58
+ if ( ! _storeInformationSettings . Value . StoreClosed )
59
+ {
60
+ return RedirectToRoute ( "HomePage" ) ;
61
+ }
62
+
54
63
return View ( ) ;
55
64
}
56
65
0 commit comments