Manual Payment & PayPal Direct Credit Card drop down select options

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi Everyone. Yet again I come in need of novice help asking if anybody could give me any guidance on how I can change the dropdown select items (specifically remove Discover and Amex options) in the Manual Payment and PayPal Direct plugins.

I am new to the NET Core framework that 4.0 is developed in and thought I could simply remove the two Select items in the .cs files in the source code, rebuild the project and then copy the new .dll and .pdb files that were created to the server and restart the application online. This had disastrous results and luckily I kept a copy of the two original files to reverse my mess.

If anyone could give me a step by step method of how to do this without completely destroying the whole website I would be very appreciative. If it turns out to be all too hard I am also willing to pay for someone else's services.

Hope you can help.

Cheers
5 years ago
Probably repeating what you did - I just commented out the two lines in the plugin

                    new SelectListItem { Text = "Visa", Value = "visa" },
                    new SelectListItem { Text = "Master card", Value = "MasterCard" },
                    //new SelectListItem { Text = "Discover", Value = "Discover" },
                    //new SelectListItem { Text = "Amex", Value = "Amex" },

Also change the version in plugin.json file to 1.43 (so you know new version is installed later)

Rebuilt solution and check it all worked fine - I assume you did the same and checked the program in your development system ?

What files did you copy to server - should have only been the new files in directory \Presentation\Nop.Web\Plugins\Payments.Manual

So you did all that correctly - Did you uninstall and re-install the plugin in ?

But you did not say what the problem was / what went wrong ?
5 years ago
Thanks for your prompt reply.
What I did differently was actually delete the two select rows from the file rather than comment them out. Maybe somewhere it is searching for 4 lines and the 2 created problems?

I may try it again with the commenting instead.

My exact process and results are as follows:

(just for background reference - I uploaded the no-source application directly to the server after downloading it from NopCommerce with no modifications - just straight out the box. This ran perfectly and then I imported the old v3.6 database which was updated with scripts and also ran fine and installed a Nop-Templates Traction Theme and associated plugins).

1. Opened the "Source" v4.0 project that I downloaded at the same time as "no-source" but never used up until this point.

2. Openened the following 2 .cs files and deleted the two select rows (new SelectListItem { Text = "Amex", Value = "Amex" }, & new SelectListItem { Text = "Discover", Value = "Discover" },) that I no longer needed from the code:
Nop.Plugin.Payments.Manual
Nop.Plugin.Payments.PayPalDirect

3. After removing the select lines and saving the two files I then went to Build>Rebuild Nop.Plugin.Payments.Manual and then Build>Rebuild Nop.Plugin.Payments.PayPalDirect respectively.

4. I then took a copy of the original ddl and pdb files (the only two I noted that were updated (date wise) in the local directory) from the server and uploaded the new ones to the directory from \Presentation\Nop.Web\Plugins\Payments.Manual & PayPalDirect

5. I refreshed the website and noticed no change and realised that I had not restarted it to lock the changes in, so on the server I restarted the website and iis app pool for the site.

6. I then refreshed the browser and saw that the front end would not load fully. It only loaded to the first two items of the main menu and then the page was blank after that. This happened after retrying around 6 times. I then tried reloading the admin area and the page told me there was a problem and I needed to contact support. This also remained after retrying a few times.

7. I now thought I'd ruined everything so in a last ditch attempt I removed the two files (dll and pdb) I had upload and replaced them with the original ones. I then restarted the website and iss app pool and after a few minutes everything came back as normal.

After that experience (it is not my website but a client's and they depend on it for their livelihood from the sales) I am slightly worried to do anything again in case it's not so forgiving next time.

Can you see where I went wrong in the above steps and what I should have done differently?

Thanks again for you help!
5 years ago
Hi again.
I went ahead and did exactly what you said with the commenting out in your method, rebuilt, and then replaced the entire plugin and all seems to have worked perfectly. Thank you!

I now realise what happened last time as well; a rookie mistake. I didn't give the server long enough to restart the application and Chrome was caching information. It has a vicious caching method.

Thanks again for your help.
5 years ago
Ok, something has happened since we updated this dll. The website keeps failing to start. It has happened twice now over a period of 2 weeks and each time the error logs say this:

Application startup exception: System.Exception: Plugin 'Credit Card'. Access to the path 'hostingspace\wwwroot\Plugins\bin\Nop.Plugin.Payments.Manual.dll' is denied.

This is the one that was updated and used to change the credit card dropdown in the previous part of my question. What would have happened to it to now not let it run sometimes when the app starts? Is it related to this: https://www.nopcommerce.com/boards/t/49851/serious-iis-application-pool-recycling-bugdesign-flaw.aspx?p=5
5 years ago
Check that you have read & write permissions on \Plugins folder.
5 years ago
Thanks for the input. Yes, the permissions were already set to read/write.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.