Author Topic: Change in Invoice.php to change pdf title  (Read 1804 times)

rishabhchd19

  • Beginner
  • *
  • Posts: 13
  • A beginner
Change in Invoice.php to change pdf title
« 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?


alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2045
    • alatak.net
Re: Change in Invoice.php to change pdf title
« Reply #1 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.

rishabhchd19

  • Beginner
  • *
  • Posts: 13
  • A beginner
Re: Change in Invoice.php to change pdf title
« Reply #2 on: March 30, 2017, 23:13:15 pm »
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.

rishabhchd19

  • Beginner
  • *
  • Posts: 13
  • A beginner
Re: Change in Invoice.php to change pdf title
« Reply #3 on: March 30, 2017, 23:21:19 pm »
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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10076
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Change in Invoice.php to change pdf title
« Reply #4 on: April 03, 2017, 17:23:34 pm »
Be sure to override FE and BE
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

rishabhchd19

  • Beginner
  • *
  • Posts: 13
  • A beginner
Re: Change in Invoice.php to change pdf title
« Reply #5 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'