How to override view file from plugin and make it compatible with all themes of vendors, without changing anything?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I'm working some project to create nopCommerce plugin, in which plugin overriding the view pages.

For instance, my custom plugin overriding view files _ProductAttributes.cshtml of Nop.Web > Views > Product.
So, I copied that file in my plugin and add some custom code into it. I'm using plugin custom view engine to override view pages.

Currently, in this case if end user is using third party theme and they have to create one folder in plugin view directory and paste view files over there.

Here is the plugin folder structure in this case:

-Plugin
-Themes
  -{user's theme name}          
   - Views
    - Product
     -_ProductAttributes.cshtml


And every time user need add those custom changes to the theme's view file. Up to now it's working fine!

But I don't want to copied that override file in plugin folder and add my custom changes every time...
Is there any straight forward way to so? without making any changes to the theme's file?
6 years ago
Bump!
anyone?
6 years ago
Hina♦ wrote:
I'm working some project to create nopCommerce plugin, in which plugin overriding the view pages.
.


I think you have to follow this url.

https://www.nopcommerce.com/boards/t/49940/nopcommerce-40-how-can-i-override-nopviewcomponent.aspx
6 years ago
sk5202 wrote:
I'm working some project to create nopCommerce plugin, in which plugin overriding the view pages.
.


I think you have to follow this url.

https://www.nopcommerce.com/boards/t/49940/nopcommerce-40-how-can-i-override-nopviewcomponent.aspx


Hi there,

I'm working with nop 3.90
6 years ago
Hina♦ wrote:

Hi there,

I'm working with nop 3.90


You have to follow below urls.

https://www.pronopcommerce.com/3-ways-to-display-views-in-your-nopcommerce-plugins-embedded-resource-theme-override-and-custom-view-engine

http://alexwolfthoughts.com/overriding-nopcommerce-admin-views-and-partial-views/
6 years ago
I'm following the same, and it's working fine!
My question is different, please read the question again, I want to make it theme compatible without any changes!
Is it possible?
6 years ago
Hina♦ wrote:
I'm following the same, and it's working fine!
My question is different, please read the question again, I want to make it theme compatible without any changes!
Is it possible?


can you tell me you are following which solution exactly ?
6 years ago
alihatam wrote:
I'm following the same, and it's working fine!
My question is different, please read the question again, I want to make it theme compatible without any changes!
Is it possible?

can you tell me you are following which solution exactly ?


I'm using Custom View Engine solution.
6 years ago
So your plugin has a Custom View Engine which overrides _ProductAttributes.cshtml

And the custom theme plugin has a Custom View Engine which overrides _ProductAttributes.cshtml

It sounds like you need to make sure your Custom View Engine executes first. I don't have any experience with Custom View Engines, but there should be some way to do this.
6 years ago
Also, don't create duplicate topics -
https://www.nopcommerce.com/boards/t/41772/custom-view-engine-cannot-find-views-in-plugin-if-same-view-exists-in-theme-or-default-view.aspx#200461
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.