Skip to content

Instantly share code, notes, and snippets.

@ruthgeridema
Last active April 17, 2019 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruthgeridema/5969748609a9a0330923225d8da30133 to your computer and use it in GitHub Desktop.
Save ruthgeridema/5969748609a9a0330923225d8da30133 to your computer and use it in GitHub Desktop.
GuestPrintInvoice.php patch | https://www.guapa.nl
Index: vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintInvoice.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintInvoice.php (date 1555328748000)
+++ vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintInvoice.php (date 1555328748000)
@@ -34,8 +34,11 @@
if ($invoiceId) {
$invoice = $this->invoiceRepository->get($invoiceId);
+ $invoiceOrder = $invoice->getOrder();
- if ($invoice) {
+ if ($invoice &&
+ $this->orderViewAuthorization->canView($invoiceOrder)
+ ) {
$document = $this->invoiceDocumentFactory->create(
['data' => ['invoice' => $invoice]]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment