Prestashop:PDF发票副本和新的第三方物流
如何在Prestashop中复制生成发票PDF过程?我想使用不同的tpl文件,但其余的应该保持不变 让我解释一下,我已经做了什么:Prestashop:PDF发票副本和新的第三方物流,prestashop,prestashop-1.6,Prestashop,Prestashop 1.6,如何在Prestashop中复制生成发票PDF过程?我想使用不同的tpl文件,但其余的应该保持不变 让我解释一下,我已经做了什么: HTMLTemplateInvoice作为HTMLTemplateMahnung并更改了类名 添加:常量模板_MAHNUNG='MAHNUNG';到文件classes/pdf/pdf.php 已在root/pdf文件夹中创建文件mahnung.tpl 添加到AdminPdfController.php: public function processGenerate
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.'));
}}
现在它开始工作了。有人知道我为什么要这么做吗?我没有看到任何核心文件的包含:SPretashop使用文件cache/class_index.php来跟踪它需要的类
每次添加新覆盖,甚至类或控制器时,都需要删除(或重命名)此文件。如果找不到,Prestashop将重新创建集合文件夹(类、控制器、覆盖和其他)中所有文件的索引。Pretashop使用文件缓存/class_index.php跟踪它所需的类 每次添加新覆盖,甚至类或控制器时,都需要删除(或重命名)此文件。如果找不到,Prestashop将重新创建集合文件夹(类、控制器、覆盖和其他)中所有文件的索引
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);
}