From ee387abbf023b68864f539f8798b66759a65cc90 Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 31 Aug 2023 12:44:27 +0200 Subject: [PATCH 1/4] Update csp_whitelist to include api-acc --- etc/csp_whitelist.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml index 989487b..903fd54 100644 --- a/etc/csp_whitelist.xml +++ b/etc/csp_whitelist.xml @@ -5,17 +5,20 @@ https://widget-acc.paazl.com + https://api-acc.paazl.com/ https://widget-acc.paazl.com + https://api-acc.paazl.com/ https://widget-acc.paazl.com + https://api-acc.paazl.com/ - \ No newline at end of file + From aca4a303179c2ee2675ee5f243938d10dbe1672c Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 31 Aug 2023 12:47:21 +0200 Subject: [PATCH 2/4] Added locker tab option --- Model/System/Config/Source/AvailableTabs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Model/System/Config/Source/AvailableTabs.php b/Model/System/Config/Source/AvailableTabs.php index 90b6f15..6c43fd0 100755 --- a/Model/System/Config/Source/AvailableTabs.php +++ b/Model/System/Config/Source/AvailableTabs.php @@ -30,7 +30,8 @@ public function toOptionArray() $this->options = [ ['value' => 'DELIVERY', 'label' => __('Delivery')], ['value' => 'STORE', 'label' => __('Store')], - ['value' => 'PICKUP', 'label' => __('Pickup')] + ['value' => 'PICKUP', 'label' => __('Pickup')], + ['value' => 'PARCEL_LOCKER', 'label' => __('Parcel Locker')] ]; } From 21bdb2ea1873e81ad6885567093a9e2de77ec0d6 Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 31 Aug 2023 12:58:19 +0200 Subject: [PATCH 3/4] Fixed wrong shipping cost in order summary --- .../Admin/Order/Create/WidgetConfigProvider.php | 3 ++- Model/Checkout/WidgetConfigProvider.php | 16 ++++++++++------ Model/Order/WidgetConfigProvider.php | 3 ++- 3 files changed, 14 insertions(+), 8 deletions(-) mode change 100644 => 100755 Model/Checkout/WidgetConfigProvider.php mode change 100644 => 100755 Model/Order/WidgetConfigProvider.php diff --git a/Model/Admin/Order/Create/WidgetConfigProvider.php b/Model/Admin/Order/Create/WidgetConfigProvider.php index eab9ac4..33d45fb 100755 --- a/Model/Admin/Order/Create/WidgetConfigProvider.php +++ b/Model/Admin/Order/Create/WidgetConfigProvider.php @@ -159,7 +159,8 @@ public function getConfig() ], "shipmentParameters" => [ "totalWeight" => $this->getTotalWeight(), - "totalPrice" => $this->getQuote()->getSubtotalWithDiscount(), + "totalPrice" => $this->getQuote()->getSubtotalWithDiscount() - + $this->getQuote()->getShippingAddress()->getShippingAmount(), "numberOfGoods" => $this->getProductsCount(), "goods" => $goods ], diff --git a/Model/Checkout/WidgetConfigProvider.php b/Model/Checkout/WidgetConfigProvider.php old mode 100644 new mode 100755 index 060f890..40ea1d1 --- a/Model/Checkout/WidgetConfigProvider.php +++ b/Model/Checkout/WidgetConfigProvider.php @@ -128,8 +128,8 @@ public function getConfig() "quantity" => $item->getParentItem() ? (int)($item->getParentItem()->getQty()) : (int)$item->getQty(), - "weight" => doubleval($item->getWeight()), - "price" => $this->itemHandler->getPriceValue($item) + "weight" => doubleval($item->getWeight()), + "price" => $this->itemHandler->getPriceValue($item) ]; if ($useDimensions) { $product = $this->productRepository->getById($item->getProduct()->getId()); @@ -187,7 +187,8 @@ public function getConfig() ], "shipmentParameters" => [ "totalWeight" => (float)$this->getTotalWeight($goods), - "totalPrice" => 0.0000, + "totalPrice" => (float)$this->getQuote()->getSubtotalWithDiscount() - + $this->getQuote()->getShippingAddress()->getShippingAmount(), "numberOfGoods" => (int)$this->getProductsCount(), "goods" => $goods ], @@ -203,16 +204,19 @@ public function getConfig() switch ($this->scopeConfig->getTotalPrice()) { case "grand_total": - $totalPriceValue = (float) $shippingAddress->getGrandTotal(); + $totalPriceValue = (float) $shippingAddress->getGrandTotal() - + $this->getQuote()->getShippingAddress()->getShippingAmount(); break; case "subtotal_excl_discount": - $totalPriceValue = (float) $shippingAddress->getSubtotalInclTax(); + $totalPriceValue = (float) $shippingAddress->getSubtotalInclTax() - + $this->getQuote()->getShippingAddress()->getShippingAmount(); break; case "subtotal_incl_discount": default: // default from config.xml = "subtotal_incl_discount" $totalPriceValue = ( (float) $shippingAddress->getSubtotalInclTax() + - (float) $shippingAddress->getDiscountAmount() + (float) $shippingAddress->getDiscountAmount() - + $this->getQuote()->getShippingAddress()->getShippingAmount() ); break; } diff --git a/Model/Order/WidgetConfigProvider.php b/Model/Order/WidgetConfigProvider.php old mode 100644 new mode 100755 index c131d37..fa43eb4 --- a/Model/Order/WidgetConfigProvider.php +++ b/Model/Order/WidgetConfigProvider.php @@ -109,7 +109,8 @@ public function getConfig() ], 'shipmentParameters' => [ 'totalWeight' => $this->getTotalWeight(), - 'totalPrice' => $this->getOrder()->getSubtotal(), + 'totalPrice' => $this->getOrder()->getSubtotal() - + $this->getOrder()->getShippingAddress()->getShippingAmount(), 'numberOfGoods' => $this->getProductsCount(), 'goods' => $goods ], From 221e7ed63e4b2f8dd7fd84711c6f093d97bc84f0 Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 31 Aug 2023 12:59:39 +0200 Subject: [PATCH 4/4] Version bump --- composer.json | 2 +- etc/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a1500de..32451e2 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "paazl/magento2-checkout-widget", "description": "Paazl checkoutWidget for Magento 2", "type": "magento2-module", - "version": "1.14.1", + "version": "1.15.0", "keywords": [ "Paazl", "Magento 2", diff --git a/etc/config.xml b/etc/config.xml index 70fb00b..d5ce713 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -8,7 +8,7 @@ - v1.14.1 + v1.15.0 0 0 0