How nopCommerce works with FindPartialView method and useCache parameter

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hello,

I have created one plugin in which I have override an existing core View. For example Vendor template and partial view _productBox as well. I have declared my custom path using View Engine and have insert it at 0 position using RouteProvider.

While debugging I noticed that initially in FindPartialView Method it will take my custom path. But because of useCache parameter has true value it returns null and then it will start rendering default path which nopCommerce has defined in ThemeableRazorViewEngine and return null because of useCache parameter has true value. But then again one more call to FindPartialView Method with default path and this time with useCache = False.

Can anybody explain me how nopCommerce handle second call with useCache = False value?

Why it did not render my custom path with useCache = False value?
7 years ago
I have the same issue. I inserted a custom ViewEngine in my plugin. I am also trying to rewrite the _ProductBox.cshtml partial view inside the plugin.

While I was debugging I noticed that FindPartialView is first called by the MVC framework with useCache true. But it is called like that for every view engine. Only after the view is searched in all view engines and not found, the FindPartialView method is called with useCache false, also for all view engines.

The problem is that the _ProductBox.cshtml partial view should be found in my plugin files, but it isn't because of useCache true, and then it is found in the nopCommerce ThemeableVirtualPathProviderViewEngine, before the call to FindPartialView with useCache false.

Does anyone have any idea of how to solve this problem?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.