nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.31k stars 5.33k forks source link

NopHtml.AddScriptParts not working in one page checkout #6143

Closed aalruthai closed 2 years ago

aalruthai commented 2 years ago

nopCommerce version: 4.50

Steps to reproduce the problem: I've created a payment plugin that uses javascript libraries, I add the script file to my plugin's PaymentInfo.cshtml view using the helper method NopHtml.AddScriptParts(ResourceLocation.Footer, "~/Plugins/Nop.Plugin.Payments.myPlugin/Scripts/myscript.js", "", true, false);

when I use one page checkout the script file is not loaded when I reach the payment step, but when I use the multi-step checkout the script file is loaded when I reach the payment step. Is this a bug or am I using the NopHtml.AddScriptParts wrong?

RomanovM commented 2 years ago

For the one-page checkout, you need to add scripts from the backend, see how this was done in our Square payment plugin.

aalruthai commented 2 years ago

Thanks, it worked