我尝试在 Shipment PDF 中获取 customerId。
我试过这段代码(输出在 // 之后的任何行的右边)
$order = $shipment->getOrder();
$this->page->drawText($order->getCustomerEmail(), $this->margin_left, $this->y, $this->charset); //outputs the correct email
$this->page->drawText($order->getCustomerName(), $this->margin_left, $this->y, $this->charset); //outputs the correct name
$this->page->drawText($order->getCustomerId(), $this->margin_left, $this->y, $this->charset); //outputs nothing
$this->page->drawText(var_export($order->getCustomerId(), true), $this->margin_left, $this->y, $this->charset); //outputs 'NULL'
我是否忘记了绘制正确的客户 ID 的东西?我当前的版本是 1.6.2。
感谢您的解决方案。