VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: cristina on May 22, 2012, 19:35:11 PM

Title: pdf document names
Post by: cristina on May 22, 2012, 19:35:11 PM
Hi,
each time you click on "invoice" in the order list you get a pdf document with the name "Joomla.pdf".
I would like to change this doc name to something more meaningful like "invoicexxxxxx.pdf".
Can someone tell me if it is possible?

Thank a lot
Cristina
Title: Re: pdf document names
Post by: Master_gray on May 24, 2012, 10:32:09 AM
Hi

Can you send a screenshot?
Did you change the name in the (shop) menu in VM,see if it works.
Title: Re: pdf document names
Post by: cristina on May 24, 2012, 19:00:05 PM
Hi,
I do not know what screen shot I should attach.
The page I'm referring to is the standard "orders" page of VM.
If you click on the "invoice" image of any order, it creates a pdf file and sends it to your browser.
If you use firefox on mac the result is that your browser will ask you to save a document with the name Joomla.pdf.
If you use firefox on a pc, it will open a popup with the pdf in it, and if you click the save it will prompt you to save a "index.pdf" document.
I would like to know if there is a way to gice the document a meaningful name.

Cristina
Title: Re: pdf document names
Post by: Master_gray on June 19, 2012, 14:13:20 PM
Hi there sorry for taking so long been busies,

Try going to "Global Configuration" in joomla and then "server" under mail settings change the "From name" see if it works and tell me please.
If it does not work i will see what i can do.

Best regards Master_gray.
Title: Re: pdf document names
Post by: Nimeshin on June 28, 2012, 11:55:08 AM
Hi all

did you manage to figure this out? i also want to change the  invoice pdf document name that gets attached to the email that is sent to the customer. Want to remove the "vm" part.

Thanks
Title: Re: pdf document names
Post by: dorex on April 10, 2013, 08:19:12 AM


Same problem here, and I see that there's no solution for it.
I did the following and didn't work.
Quote from: Master_gray on June 19, 2012, 14:13:20 PM
Try going to "Global Configuration" in joomla and then "server" under mail settings change the "From name" see if it works and tell me please.
If it does not work i will see what i can do.

Best regards Master_gray.

Please help.

Thank you
Title: Re: pdf document names
Post by: Nimeshin on April 10, 2013, 08:37:48 AM
Hi

check solution here for pdf invoice renaming

http://forum.virtuemart.net/index.php?topic=103837.new;topicseen#new

Title: Re: pdf document names
Post by: dorex on April 10, 2013, 09:33:50 AM
Quote from: Nimeshin on April 10, 2013, 08:37:48 AM
Hi

check solution here for pdf invoice renaming

http://forum.virtuemart.net/index.php?topic=103837.new;topicseen#new



Thank you for your quick response. I tried that, but it didn't work. I think it's because of the whitespaces in my invoice number:  e.g. "Serie DOC-2013 No. 0001"

I think in the file:  /components/com_virtuemart/controllers/invoice.php

I should alter the following line somehow to remove the whitespaces from the invoice number, before using it to name the pdf file:

$path .= preg_replace('/[^A-Za-z0-9_\-\.]/', '_', 'vminvoice_'.$invoiceNumber.'.pdf');

Can anyone help me with this one?

Thank you in advance.

Title: Re: pdf document names
Post by: sr9yar on February 12, 2014, 15:44:06 PM
for VM2 edit this line :
   $path .= preg_replace('/[^A-Za-z0-9_\-\.]/', '_', 'vm'.$layout.'_'.$invoiceNumber.'.pdf');
   
ta -da !!! ta -da !!! ta -da !!! ta -da !!! ta -da !!! ta -da !!! ta -da !!!