diff --git a/classes/PDF.php b/classes/PDF.php index 3cb9c399c..769479b5e 100644 --- a/classes/PDF.php +++ b/classes/PDF.php @@ -487,7 +487,7 @@ class PDFCore extends PDF_PageGroupCore if (!$context) $context = Context::getContext(); - if (!Validate::isLoadedObject($order) OR ((isset($context->employee) && !$context->employee->id) AND (!OrderState::invoiceAvailable($order->getCurrentState()) AND !$order->invoice_number))) + if (!Validate::isLoadedObject($order) OR (!Validate::isLoadedObject($context->employee) AND (!OrderState::invoiceAvailable($order->getCurrentState()) AND !$order->invoice_number))) die('Invalid order or invalid order state'); self::$order = $order; self::$orderSlip = $slip; diff --git a/controllers/PdfInvoiceController.php b/controllers/PdfInvoiceController.php index 39968dafb..2843e350c 100644 --- a/controllers/PdfInvoiceController.php +++ b/controllers/PdfInvoiceController.php @@ -27,6 +27,13 @@ class PdfInvoiceControllerCore extends FrontController { + public function run() + { + $this->init(); + $this->preProcess(); + $this->process(); + } + public function process() { parent::process(); diff --git a/controllers/pdfOrderReturnController.php b/controllers/pdfOrderReturnController.php index 5bfdbc6cf..ee559363f 100644 --- a/controllers/pdfOrderReturnController.php +++ b/controllers/pdfOrderReturnController.php @@ -27,6 +27,13 @@ class PdfOrderReturnControllerCore extends FrontController { + public function run() + { + $this->init(); + $this->preProcess(); + $this->process(); + } + public function process() { parent::process(); diff --git a/controllers/pdfOrderSlipController.php b/controllers/pdfOrderSlipController.php index 7b22590c8..0265dd3cb 100644 --- a/controllers/pdfOrderSlipController.php +++ b/controllers/pdfOrderSlipController.php @@ -27,6 +27,13 @@ class PdfOrderSlipControllerCore extends FrontController { + public function run() + { + $this->init(); + $this->preProcess(); + $this->process(); + } + public function process() { parent::process(); diff --git a/themes/prestashop/order-detail.tpl b/themes/prestashop/order-detail.tpl index 0a0eabede..1cd103e9e 100644 --- a/themes/prestashop/order-detail.tpl +++ b/themes/prestashop/order-detail.tpl @@ -77,9 +77,9 @@

{if $is_guest} - id&secure_key=$order->secure_key")}" >{l s='Download your invoice as a .PDF file'} + id}&secure_key=$order->secure_key")}" >{l s='Download your invoice as a .PDF file'} {else} - id")}" >{l s='Download your invoice as a .PDF file'} + id}")}" >{l s='Download your invoice as a .PDF file'} {/if}

{/if}