VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: rishabhchd19 on March 30, 2017, 02:06:12 AM

Title: Change in Invoice.php to change pdf title
Post by: rishabhchd19 on March 30, 2017, 02:06:12 AM
I have changed

      $path .= preg_replace('/[^A-Za-z0-9_\-\.]/', '_', 'order'.$layout.'_'.$invoiceNumber.'.pdf');
      //$path .= shopFunctionsF::getInvoiceName($invoiceNumber, $layout).'.pdf';

Before it was:

      //$path .= preg_replace('/[^A-Za-z0-9_\-\.]/', '_', 'order'.$layout.'_'.$invoiceNumber.'.pdf');
      $path .= shopFunctionsF::getInvoiceName($invoiceNumber, $layout).'.pdf';

why it was put to comment $path .= shopFunctionsF::getInvoiceName($invoiceNumber, $layout).'.pdf';  ?
The changes i have made gonna make problems? What was the reason behind making first line as a comment?

If i keep the first line under comment, then how can I change title of pdf from VMINVOICE to ORDERINVOICE with the second line?

Title: Re: Change in Invoice.php to change pdf title
Post by: alatak on March 30, 2017, 11:06:23 AM
Hello

Do an overwrite of the key COM_VIRTUEMART_FILEPREFIX_INVOICE , and it should work without having to hack the code which is a very bad idea.
Title: Re: Change in Invoice.php to change pdf title
Post by: rishabhchd19 on March 30, 2017, 23:13:15 PM
Quote from: alatak on March 30, 2017, 11:06:23 AM
Hello

Do an overwrite of the key COM_VIRTUEMART_FILEPREFIX_INVOICE , and it should work without having to hack the code which is a very bad idea.

sorry no idea how to overwrite keys. I am a beginner.
Title: Re: Change in Invoice.php to change pdf title
Post by: rishabhchd19 on March 30, 2017, 23:21:19 PM
Quote from: rishabhchd19 on March 30, 2017, 23:13:15 PM
Quote from: alatak on March 30, 2017, 11:06:23 AM
Hello

Do an overwrite of the key COM_VIRTUEMART_FILEPREFIX_INVOICE , and it should work without having to hack the code which is a very bad idea.

sorry no idea how to overwrite keys. I am a beginner.


I have done it. Thanks
Title: Re: Change in Invoice.php to change pdf title
Post by: Milbo on April 03, 2017, 17:23:34 PM
Be sure to override FE and BE
Title: Re: Change in Invoice.php to change pdf title
Post by: rishabhchd19 on July 02, 2017, 05:42:42 AM
Overriding making change when Invoice download from Admin panel, at frontend when customer receives email of pdf invoice ni changes reflected..name remain same as 'vminvoice'