From e365db6aed983a8b62149ae3d3cad2ec5b15f688 Mon Sep 17 00:00:00 2001 From: Marinela Levak Date: Wed, 6 May 2020 10:54:03 +0200 Subject: [PATCH] Ensure that JavaScript functions are defined before they are used when plugin was installed on several web-shops, on some of them sometimes the image wasn't properly displayed (empty parts of image weren't cropped) and the button for downloading payment slip image was not working. That was caused since image-cropping function definition was defined after the event handler that triggers it. --- src/Wooplatnica.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Wooplatnica.php b/src/Wooplatnica.php index c404a6f..f345b5c 100644 --- a/src/Wooplatnica.php +++ b/src/Wooplatnica.php @@ -88,16 +88,8 @@ private function display_payment_slip($order, $is_for_sending) { $payment_slip_image_data_uri = "data:image/$image_type;base64," . base64_encode($payment_slip_blob); echo <<< EOS -
-
-
- $img_element_alt -
-
-
- - +
+
+
+ $img_element_alt +
+
+
+ +