Why not try this instead? [url=Overriding (Intercepting) nopCommerce Controllers and Actions]http://www.pronopcommerce.com/overriding-intercepting-nopcommerce-controllers-and-actions[/url]
I have tried it, but seem like I need to redirect to the path that I customize it. Is there anyway, I just want to keep the url but the controller and action is the one I've created?
I don't get "but seem like I need to redirect to the path that I customize it". Can you explain again? :)
okay just get the example of StoreClosedAttribute, the system redirect to StoreClosed page and the url path is change to /StoreClosed. But what I want it is the url path didn't change. For example, /customer/info. Suppose the ActionName Info in CustomerController is executing, but I want it to be CustomCustomerController.
I've successfully make it work by creating RouteProvider for frontend. For backend, I've created an AreaRegistration to overlap it and it's work too, but sometimes doesn't work.
The line that make it redirect is
Remove it and it'll stay with the same Action. :)
I have tried it, but seem like I need to redirect to the path that I customize it. Is there anyway, I just want to keep the url but the controller and action is the one I've created?
I don't get "but seem like I need to redirect to the path that I customize it". Can you explain again? :)
okay just get the example of StoreClosedAttribute, the system redirect to StoreClosed page and the url path is change to /StoreClosed. But what I want it is the url path didn't change. For example, /customer/info. Suppose the ActionName Info in CustomerController is executing, but I want it to be CustomCustomerController.
I've successfully make it work by creating RouteProvider for frontend. For backend, I've created an AreaRegistration to overlap it and it's work too, but sometimes doesn't work.
The line that make it redirect is
if (storeInformationSettings.StoreClosedAllowForAdmins && EngineContext.Current.Resolve<IWorkContext>().CurrentCustomer.IsAdmin())
{
//do nothing - allow admin access
}
else
{
var storeClosedUrl = new UrlHelper(filterContext.RequestContext).RouteUrl("StoreClosed");
filterContext.Result = new RedirectResult(storeClosedUrl); // <-- this line makes it redirect
}
Remove it and it'll stay with the same Action. :)
I think I get what you means thanks