1
如何在Prestashop中复制Generate Invoice PDF Process?我想使用不同的tpl文件,但其余的应该保持不变。Prestashop:使用新的tpl复制发票PDF
让我解释一下,我已经做了:
- HTMLTemplateInvoice为HTMLTemplateMahnung和改变类的名称。
- 加了:const TEMPLATE_MAHNUNG ='Mahnung';该文件中的类/ PDF/PDF.php 根/ PDF文件
加入AdminPdfController.php
- 创建文件mahnung.tpl:
public function processGenerateMahnungPdf() { if (Tools::isSubmit('id_order')) { $this->generateMahnungPDFByIdOrder(Tools::getValue('id_order')); } elseif (Tools::isSubmit('id_order_invoice')) { $this->generateInvoicePDFByIdOrderInvoice(Tools::getValue('id_order_invoice')); } else { die(Tools::displayError('The order ID -- or the invoice order ID -- is missing.')); }}
和
public function generateMahnungPDFByIdOrder($id_order)
{
$order = new Order((int)$id_order);
if (!Validate::isLoadedObject($order)) {
die(Tools::displayError('The order cannot be found within your database.'));
}
$order_invoice_list = $order->getInvoicesCollection();
Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list));
$this->generatePDF($order_invoice_list, PDF::TEMPLATE_MAHNUNG);
}
但它不工作。它只是不会生成PDF。
任何帮助?
UPDATE
我必须包含类:require_once _PS_ROOT_DIR_。 '/classes/pdf/HTMLTemplateMahnung.php';
现在它的工作。任何人都知道我为什么要这样做?我没有看到任何包含的核心文件:S
非常感谢!这是问题... –