Page 1 of 1

Change PDF name

Posted: 19 Apr 2024, 21:12
by Nidzo
I can't change name of PDF file that is attached in e-mail. Now it is named as 2024.
I change it in PhocaCart Plugin but it still shows same.
Phoca Cart 5.0.0 Beta49
Phoca PDF 5.0.0
PhocaPDFPhocaCartPlugin 5.0.1
Image

Re: Change PDF name

Posted: 22 Apr 2024, 13:55
by Jan
Hi, what exactly is the attachment? The PDF name in plugin is e.g. ignored for files which are sent per email so each gets right info. For example, order has following name:

Code: Select all

$staticData['filename'] = strip_tags(Text::_('COM_PHOCACART_ORDER') . '_' . $orderNumber) . '.pdf';
This is set in:
administrator/components/com_phocacart/libraries/phocacart/order/status.php

Jan

Re: Change PDF name

Posted: 22 Apr 2024, 14:59
by Nidzo
The attachment is Invoice.

Re: Change PDF name

Posted: 22 Apr 2024, 20:20
by Jan
This is the same like for order, the code line is:

Code: Select all

$staticData['filename'] = strip_tags(Text::_('COM_PHOCACART_INVOICE') . '_' . $invoiceNumber) . '.pdf';
so I wonder how you can get only year as the file name ???


Jan

Re: Change PDF name

Posted: 22 Apr 2024, 21:29
by Nidzo
Jan wrote: 22 Apr 2024, 20:20 This is the same like for order, the code line is:

Code: Select all

$staticData['filename'] = strip_tags(Text::_('COM_PHOCACART_INVOICE') . '_' . $invoiceNumber) . '.pdf';
I have the same code in my Phoca Cart

This is how I set invoice name creation:
Image

Re: Change PDF name

Posted: 22 Apr 2024, 21:40
by Nidzo
OK. I found it.
/ is not permitted in Number Format
I changed {orderid}/{year} to {orderid}-{year}

Re: Change PDF name

Posted: 24 Apr 2024, 18:14
by Jan
Ok