I have a a project with nopCommerce 3.9, when logging to the admin portal and change the payment method friendly name from Configuration > payment > payment method.
Then clicking edit to change the friendly name of (Check / Money Order) it changed successfully but after rebuild the nopCommerce project the Friendly Name returned to its default value again (Check/Money Order)
How can I prevent it from returning to its default value after rebuild ??
This is really interesting question, and you'll learn a lot after debugging the code. First of all, let's understand the how nopCommerce loading the plugins.
Problem:
When you build any plugin, it will generate DLLs and static files inside
Presentation > Nop.Web > Plugins
folder, and that folder being used through out the app.Now when you change the
FrindlyName
from admin side, it'll update Description.txt file insideNop.Web > Plugins > Payment.CheckMoneyOrder
.However, your main plugin code located at
Root > Plugins > Nop.Plugin.Payments.CheckMoneyOrder
which also contains Description.txt file, and that would be actual one, as you haven't modified it yet.So, when you build the solution, it will override the description file that you've modified previously. And that is why you facing this issue after build the project.
Solution: Change property "Copy to Output Directory" of description file to "do not copy".