Allow navigation only for registered customers

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Is there a way to enable navigation for non-registered customers, to few specific pages? (Version 1.5)

For example, non-registered customer can see the 'About us' page, but not anything else

Thanks!
13 years ago
yea there are few ways. you can change web config to do that. this is just common task in asp .net generally.
13 years ago
thanks for the tip ;)

Some code on the web.config?
Or on any asp page of nomcommerce?
13 years ago
NikolasL wrote:
thanks for the tip ;)

Some code on the web.config?
Or on any asp page of nomcommerce?


Yes I just had a look and you can it the way nopcommerce is doing.

In any code file of page. add this line to pageload

            if (NopContext.Current.User == null || NopContext.Current.User.IsGuest)
            {
                string loginURL = SEOHelper.GetLoginPageUrl(true);
                Response.Redirect(loginURL);
            }

This would redirect non registered users to the login page.

Hope that helps
13 years ago
Is there a way to do this for category/product pages?  I placed the script into Product.aspx.cs and Category.aspx.cs ' Page_Load but it doesn't seem to have any effect.  Not really sure where else it could go...
13 years ago
Romina wrote:
Is there a way to do this for category/product pages?  I placed the script into Product.aspx.cs and Category.aspx.cs ' Page_Load but it doesn't seem to have any effect.  Not really sure where else it could go...


it should work. Have you recompiled the solution?
12 years ago
Is there a way to do something like this in 2.10?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.