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

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
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
3 года назад
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
3 года назад
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?
3 года назад
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
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.