Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.17.2 #115

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading