【发布时间】:2018-05-22 15:38:28
【问题描述】:
我一直在尝试查找生成 pdf 发票的文件以将其名称更改为用户名,例如“invoice00012”,我想要“John Smith.pdf”。我会很感激你的帮助。谢谢。
【问题讨论】:
-
我的 prestashop 版本是 1.6
标签: pdf prestashop invoice
我一直在尝试查找生成 pdf 发票的文件以将其名称更改为用户名,例如“invoice00012”,我想要“John Smith.pdf”。我会很感激你的帮助。谢谢。
【问题讨论】:
标签: pdf prestashop invoice
在classes/pdf/HTMLTemplateInvoice.php 中修改函数getFilename()。您使用$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';
}
【讨论】: