Change PDF name

Phoca Cart - complex e-commerce extension
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 268
Joined: 07 Nov 2018, 14:55

Change PDF name

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47891
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change PDF name

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 268
Joined: 07 Nov 2018, 14:55

Re: Change PDF name

Post by Nidzo »

The attachment is Invoice.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47891
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change PDF name

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 268
Joined: 07 Nov 2018, 14:55

Re: Change PDF name

Post 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
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 268
Joined: 07 Nov 2018, 14:55

Re: Change PDF name

Post by Nidzo »

OK. I found it.
/ is not permitted in Number Format
I changed {orderid}/{year} to {orderid}-{year}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47891
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Change PDF name

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply