popolun wrote:Hi,
Thank you for helping me on the coding.
However, it still shows an error.
I took the screenshot here.
http://sendfile.cc/uploads/file/201608/0.046885001471574112.png
Thank You
Ok here is the solution. Please add the reference at the view
@using Nop.Core;
@using Nop.Core.Domain.Common;
@using Nop.Core.Infrastructure;
@using Nop.Core.Domain.Customers;
the add the bellow code
var currentCustomer = EngineContext.Current.Resolve<IWorkContext>().CurrentCustomer;
if (currentCustomer.IsGuest() &&
!(Request.Url.AbsolutePath.Equals("/", StringComparison.InvariantCultureIgnoreCase)) &&
!(Request.Url.AbsolutePath.Equals("/t/PageNotFound", StringComparison.InvariantCultureIgnoreCase)) &&
!(Request.Url.AbsolutePath.Equals("/login", StringComparison.InvariantCultureIgnoreCase)))// and other pages you want to allow
{
Response.Redirect("/t/PageNotFound", true);
}
I have tested it and it seems it is working for 3.8