Skip to content

Commit

Permalink
Merge pull request #115 from Paazl/release/1.17.2
Browse files Browse the repository at this point in the history
Release/1.17.2
  • Loading branch information
Marvin-Magmodules authored Aug 30, 2024
2 parents c83ac71 + f37c0f4 commit 059a4e5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
10 changes: 7 additions & 3 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,15 @@ public function showWidgetOnFirstLoad($store = null)

/**
* @param null|Store|int|string $store
* @return float
* @return float|null
*/
public function getInsuranceValue($store = null)
public function getInsuranceValue($store = null): ?float
{
return abs((float)$this->getValue(self::API_CONFIG_PATH . '/insurance_value', $store));
$value = $this->getValue(self::API_CONFIG_PATH . '/insurance_value', $store);
if ($value === null || $value === '') {
return null;
}
return abs((float)$value);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Test/Unit/Model/Api/Builder/OrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ public function testOrderInsuredValue($configValue, $orderCurrency)
public function orderInsuredValueDataProvider()
{
return [
[0, 'EUR'],
[0, 'USD'],
[null, 'EUR'],
[null, 'USD'],
[1.05, 'EUR'],
[20.19, 'USD'],
[201.36363, 'USD'],
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.17.1",
"version": "1.17.2",
"keywords": [
"Paazl",
"Magento 2",
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<depends>
<field id="active">1</field>
</depends>
<comment>Fill in the insurance amount as a number.</comment>
<comment>Fill in the insurance amount as a number. Null will be added if the value is empty.</comment>
</field>
<field id="housenumber_default_value" translate="label comment" type="select" sortOrder="49" showInDefault="1"
showInWebsite="1" showInStore="1">
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.17.1</version>
<version>v1.17.2</version>
<active>0</active>
<sallowspecific>0</sallowspecific>
<price>0</price>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ define([
const shippingAddress = quote.billingAddress();
let currentAddress;

if (isCustomerLogin) {
if (isCustomerLogin && Object.keys(window.checkoutConfig.customerData.addresses).length > 0) {
currentAddress = selectedShippingAddress === 'new-customer-address'
? customerData.get('checkout-data')().shippingAddressFromData
: window.checkoutConfig.customerData.addresses[getAddressId()];
Expand Down

0 comments on commit 059a4e5

Please sign in to comment.