Nopcommerce payment Method friendly name returned to its default value after build the solution

180 Views Asked by At

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 ??

1

There are 1 best solutions below

1
On

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.

enter image description here

Now when you change the FrindlyName from admin side, it'll update Description.txt file inside Nop.Web > Plugins > Payment.CheckMoneyOrder.

enter image description here

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.

Group: Payment methods
FriendlyName: Check / Money Order
SystemName: Payments.CheckMoneyOrder
Version: 1.21
SupportedVersions: 3.90
Author: nopCommerce team
DisplayOrder: 1
FileName: Nop.Plugin.Payments.CheckMoneyOrder.dll
Description: This plugin enables check and money order payments

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".

enter image description here