Override PrintProducts method in pdfservice class file which is in Nop.Services project

один месяц назад
Hi All,

I want to override "PrintProducts" method in pdfservice class,which is in Nop.services project.

Is it possible to override it in my plugin without touching base code.

Thanks
один месяц назад
It is a public virtual function so yes you can

protected override void PrintProducts(int vendorId, Language lang, Font titleFont, Document doc, Font font, Font attributesFont)

Or alternatively if you just want to print the Products report from a button on a .cshtml page in your plugin then no need to override you can just call your plugins PrintProducts routine
один месяц назад
Yidna wrote:
It is a public virtual function so yes you can

protected override void PrintProducts(int vendorId, Language lang, Font titleFont, Document doc, Font font, Font attributesFont)

Or alternatively if you just want to print the Products report from a button on a .cshtml page in your plugin then no need to override you can just call your plugins PrintProducts routine


Thank you, I am aware of override functionality, but how to call my class file from the plugin instead of nop.services pdf file from Orderscontroller without changing any core code?
один месяц назад
LuckyS wrote:
It is a public virtual function so yes you can

protected override void PrintProducts(int vendorId, Language lang, Font titleFont, Document doc, Font font, Font attributesFont)

Or alternatively if you just want to print the Products report from a button on a .cshtml page in your plugin then no need to override you can just call your plugins PrintProducts routine

Thank you, I am aware of override functionality, but how to call my class file from the plugin instead of nop.services pdf file from Orderscontroller without changing any core code?


It worked, I just wrote override method in new class inherited from pdfservice class