【问题标题】:Prestashop Generate Invoice with user namePrestashop 使用用户名生成发票
【发布时间】:2018-05-22 15:38:28
【问题描述】:

我一直在尝试查找生成 pdf 发票的文件以将其名称更改为用户名,例如“invoice00012”,我想要“John Smith.pdf”。我会很感激你的帮助。谢谢。

【问题讨论】:

  • 我的 prestashop 版本是 1.6

标签: pdf prestashop invoice


【解决方案1】:

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';     
}

【讨论】:

  • 谢谢,但我无法在 getFilename() 中获取用户名,我尝试了这个“$this->context->customer”
猜你喜欢
  • 1970-01-01
  • 2017-11-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-04
  • 2021-04-01
  • 1970-01-01
相关资源
最近更新 更多