Skip to content

Commit

Permalink
Merge pull request #101 from Paazl/release/1.15.0
Browse files Browse the repository at this point in the history
Release/1.15.0
  • Loading branch information
Marvin-Magmodules authored Aug 31, 2023
2 parents 363205d + 221e7ed commit d462faa
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Model/Admin/Order/Create/WidgetConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
Expand Down
16 changes: 10 additions & 6 deletions Model/Checkout/WidgetConfigProvider.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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
],
Expand All @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion Model/Order/WidgetConfigProvider.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
Expand Down
3 changes: 2 additions & 1 deletion Model/System/Config/Source/AvailableTabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')]
];
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<default>
<carriers>
<paazlshipping>
<version>v1.14.1</version>
<version>v1.15.0</version>
<active>0</active>
<sallowspecific>0</sallowspecific>
<price>0</price>
Expand Down
5 changes: 4 additions & 1 deletion etc/csp_whitelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
<policy id="script-src">
<values>
<value id="paazl-widget-checkout" type="host">https://widget-acc.paazl.com</value>
<value id="paazl-api-checkout" type="host">https://api-acc.paazl.com/</value>
</values>
</policy>
<policy id="style-src">
<values>
<value id="paazl-widget-checkout-css" type="host">https://widget-acc.paazl.com</value>
<value id="paazl-api-checkout-css" type="host">https://api-acc.paazl.com/</value>
</values>
</policy>
<policy id="connect-src">
<values>
<value id="paazl-widget-checkout-connect" type="host">https://widget-acc.paazl.com</value>
<value id="paazl-api-checkout-connect" type="host">https://api-acc.paazl.com/</value>
</values>
</policy>
</policies>
</csp_whitelist>
</csp_whitelist>

0 comments on commit d462faa

Please sign in to comment.