I have put together a site with additional views(pages) What I am needing to do is only allow non-logged in accounts to view just the front pages and not get access to the catalog at all without being signed in.
I am using 2.3 and cannot seem to think of the best way to do this
Did you have any success with this?
I'm new to nopCommerce and MVC so if you have managed to pull this off, a code example would be amazing.
I think this is very easy.
Just add this statement in the beginning of the Category Controller:
Hi c523, thank you for the response!
I unsuccessfully tried to apply your idea to the categorynavigation.cshtml which appeared to have the potential to hide the category view from a non-registered user. I realize this is probably not how I was supposed to interpret your suggestion.
When you say at the beginning of the Category Controller, do you mean in the constructors region of the CategoryController.cs file?
Your idea makes a lot of sense, I'm just not sure where to put it exactly.
Thanks again for your help.
Try it in the Category controller and not the view I think that is where you need to aply the change not 100% but worth testing...
The Category Controller is in \Presentation\Nop.Web\Controllers\CatalogController.cs. Place it at the beginning of this action:
public ActionResult Category(int categoryId, CatalogPagingFilteringModel command)
//place the code here..
Does it work in Nop 4.20?
If not, can anyone show me how to do it?
FYI, there are some things you can 'hide' using the Access Control List (uncheck Guests)
Public store. Allow navigation
Public store. Display Prices
Public store. Enable shopping cart
Public store. Enable wishlist