I have been trying to find the file where the pdf invoice is generated to change the name of it, to the name of the user, e.g instead "invoice00012", I would like to have "John Smith.pdf". I would appreciate your help. Thanks.
Asked
Active
Viewed 144 times
-1
-
my prestashop version is 1.6 – Khan209 May 22 '18 at 15:39
1 Answers
0
Modify function getFilename()
in classes/pdf/HTMLTemplateInvoice.php
. You get the customer object using $customer = new Customer((int)$this->order->id_customer);
.
public function getFilename()
{
$customer = new Customer((int)$this->order->id_customer);
return $customer->firstname.'_'.$customer->lastname.'.pdf';
}

Roman K.
- 945
- 1
- 9
- 17
-
thanks, but I couldn't get the username in the getFilename(), I tried this "$this->context->customer" – Khan209 May 23 '18 at 14:14