From ac071edc704f1382be9817ca9b297e289578b48d Mon Sep 17 00:00:00 2001 From: Alex Chastain Date: Wed, 12 Oct 2022 19:34:31 -0500 Subject: [PATCH 1/3] added type def --- ViewModel/Pixel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ViewModel/Pixel.php b/ViewModel/Pixel.php index 9eb2877..ba633cc 100644 --- a/ViewModel/Pixel.php +++ b/ViewModel/Pixel.php @@ -132,7 +132,7 @@ public function getOrderDetails() $this->orderDetails['tax'] = number_format((float)$order->getTaxAmount() ?? 0.0, 2, '.', ''); $this->orderDetails['shipping'] = number_format((float)$order->getShippingAmount() ?? 0.0, 2, '.', ''); if (!$this->taxConfig->discountTax()) { - $this->orderDetails['discount'] = number_format((float)abs($order->getDiscountAmount()) ?? 0.0, 2, '.', ''); + $this->orderDetails['discount'] = number_format((float)abs((float)$order->getDiscountAmount()) ?? 0.0, 2, '.', ''); } else { //when discount is applied to products "including tax" - extract tax compensation amount from "discount". $this->orderDetails['discount'] = number_format( From f07736935960af0d5d553b5ca3a051da0b0cd044 Mon Sep 17 00:00:00 2001 From: Alex Chastain Date: Wed, 12 Oct 2022 20:27:45 -0500 Subject: [PATCH 2/3] updated the other condition --- ViewModel/Pixel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ViewModel/Pixel.php b/ViewModel/Pixel.php index ba633cc..a76e94e 100644 --- a/ViewModel/Pixel.php +++ b/ViewModel/Pixel.php @@ -136,7 +136,7 @@ public function getOrderDetails() } else { //when discount is applied to products "including tax" - extract tax compensation amount from "discount". $this->orderDetails['discount'] = number_format( - (float)abs($order->getDiscountAmount()) - (float)abs($order->getDiscountTaxCompensationAmount()) ?? 0.0, 2, '.', '' + (float)abs($order->getDiscountAmount()) - (float)abs((float)$order->getDiscountTaxCompensationAmount()) ?? 0.0, 2, '.', '' ); } From 0a48e718b834531022cfe62175aa761641dd3268 Mon Sep 17 00:00:00 2001 From: Alex Chastain Date: Wed, 12 Oct 2022 20:34:35 -0500 Subject: [PATCH 3/3] fixed the third one --- ViewModel/Pixel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ViewModel/Pixel.php b/ViewModel/Pixel.php index a76e94e..cd90108 100644 --- a/ViewModel/Pixel.php +++ b/ViewModel/Pixel.php @@ -136,7 +136,7 @@ public function getOrderDetails() } else { //when discount is applied to products "including tax" - extract tax compensation amount from "discount". $this->orderDetails['discount'] = number_format( - (float)abs($order->getDiscountAmount()) - (float)abs((float)$order->getDiscountTaxCompensationAmount()) ?? 0.0, 2, '.', '' + (float)abs((float)$order->getDiscountAmount()) - (float)abs((float)$order->getDiscountTaxCompensationAmount()) ?? 0.0, 2, '.', '' ); }