Skip to content

Commit 19227e3

Browse files
Merge branch 'develop'
# Conflicts: # Test/Unit/Block/Adminhtml/Config/Support/TabTest.php # etc/config.xml
2 parents 520b37e + f229d0c commit 19227e3

File tree

7 files changed

+28
-31
lines changed

7 files changed

+28
-31
lines changed

Test/Unit/Block/Adminhtml/Config/Support/TabTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testGetSupportedMagentoVersions()
5151
'moduleConfiguration' => $this->getConfigurationMock()
5252
]);
5353

54-
$this->assertSame('2.3.7-p1, 2.4.3', $instance->getSupportedMagentoVersions());
54+
$this->assertSame('2.3.7, 2.4.3', $instance->getSupportedMagentoVersions());
5555
}
5656

5757
/**+
@@ -62,7 +62,7 @@ private function getConfigurationMock()
6262
$mock = $this->getFakeMock(ModuleConfiguration::class)->getMock();
6363
$mockExpects = $mock->expects($this->once());
6464
$mockExpects->method('getSupportedMagentoVersions');
65-
$mockExpects->willReturn('2.3.7-p1, 2.4.3');
65+
$mockExpects->willReturn('2.3.7, 2.4.3');
6666

6767
return $mock;
6868
}

etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
3434
<default>
3535
<tig_postcode>
36-
<supported_magento_version>2.3.7-p1, 2.4.3</supported_magento_version>
36+
<supported_magento_version>2.3.7, 2.4.3</supported_magento_version>
3737
<stability/>
3838
<configuration>
3939
<modus>0</modus>

view/frontend/web/js/view/billing-address-mixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ define([
4040
return function (Component) {
4141
return Component.extend({
4242
tigHouseNumber: function () {
43-
if (quote.billingAddress().customAttributes.length > 0) {
43+
var customAttributes = quote.billingAddress().customAttributes;
44+
45+
if (customAttributes && customAttributes.length > 0) {
4446
var houseNumber = "";
4547
var houseNumberAddition = "";
4648

47-
var customAttributes = quote.billingAddress().customAttributes;
48-
4949
// check if custom attribute exists and is not empty
5050
customAttributes.forEach(function (attribute) {
5151
if (attribute.attribute_code === "tig_housenumber" && attribute.value !== "") {

view/frontend/web/js/view/form/fields.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,33 +97,30 @@ define([
9797
if (typeof options.data === "string") {
9898
var data = $.parseJSON(options.data);
9999

100-
// Handle Magento inconsistencies
101-
var customAttributes = 'custom_attributes';
100+
if (data != null) {
101+
// Handle Magento inconsistencies
102+
var customAttributes = 'custom_attributes';
102103

103-
if (!_.isUndefined(data.address) && !_.isUndefined(data.address[customAttributes])) {
104-
data.address = this.addToAddress(data.address, customAttributes);
105-
}
104+
if (!_.isUndefined(data.address) && !_.isUndefined(data.address[customAttributes])) {
105+
data.address = this.addToAddress(data.address, customAttributes);
106+
}
106107

107-
customAttributes = 'customAttributes';
108+
customAttributes = 'customAttributes';
108109

109-
if (!_.isUndefined(data.addressInformation) && data.addressInformation &&
110-
!_.isUndefined(data.addressInformation.shipping_address) &&
111-
!_.isUndefined(data.addressInformation.shipping_address[customAttributes])) {
112-
data.addressInformation.shipping_address = this.addToAddress(data.addressInformation.shipping_address, customAttributes);
113-
}
110+
if (!_.isUndefined(data.addressInformation) && data.addressInformation && !_.isUndefined(data.addressInformation.shipping_address) && !_.isUndefined(data.addressInformation.shipping_address[customAttributes])) {
111+
data.addressInformation.shipping_address = this.addToAddress(data.addressInformation.shipping_address, customAttributes);
112+
}
114113

115-
if (!_.isUndefined(data.addressInformation) && data.addressInformation &&
116-
!_.isUndefined(data.addressInformation.billing_address) &&
117-
!_.isUndefined(data.addressInformation.billing_address[customAttributes])) {
118-
data.addressInformation.billing_address = this.addToAddress(data.addressInformation.billing_address, customAttributes);
119-
}
114+
if (!_.isUndefined(data.addressInformation) && data.addressInformation && !_.isUndefined(data.addressInformation.billing_address) && !_.isUndefined(data.addressInformation.billing_address[customAttributes])) {
115+
data.addressInformation.billing_address = this.addToAddress(data.addressInformation.billing_address, customAttributes);
116+
}
120117

121-
if (!_.isUndefined(data.billingAddress) && data.billingAddress &&
122-
!_.isUndefined(data.billingAddress[customAttributes])) {
123-
data.billingAddress = this.addToAddress(data.billingAddress, customAttributes);
124-
}
118+
if (!_.isUndefined(data.billingAddress) && data.billingAddress && !_.isUndefined(data.billingAddress[customAttributes])) {
119+
data.billingAddress = this.addToAddress(data.billingAddress, customAttributes);
120+
}
125121

126-
return JSON.stringify(data);
122+
return JSON.stringify(data);
123+
}
127124
}
128125
},
129126

view/frontend/web/template/billing-address/details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div if="isAddressDetailsVisible() && currentBillingAddress()" class="billing-address-details">
88
<text args="currentBillingAddress().prefix"/> <text args="currentBillingAddress().firstname"/> <text args="currentBillingAddress().middlename"/>
99
<text args="currentBillingAddress().lastname"/> <text args="currentBillingAddress().suffix"/><br/>
10-
<text args="currentBillingAddress().street.join(', ')"/>
10+
<text args="currentBillingAddress().street.join(', ')" if="currentBillingAddress().street"/>
1111
<text args="tigHouseNumber()"/><br/>
1212
<text args="currentBillingAddress().city "/>, <span text="currentBillingAddress().region"></span> <text args="currentBillingAddress().postcode"/><br/>
1313
<text args="getCountryName(currentBillingAddress().countryId)"/><br/>

view/frontend/web/template/shipping-address/address-renderer/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="shipping-address-item" data-bind="css: isSelected() ? 'selected-item' : 'not-selected-item'">
88
<text args="address().prefix"/> <text args="address().firstname"/> <text args="address().middlename"/>
99
<text args="address().lastname"/> <text args="address().suffix"/><br/>
10-
<text args="address().street.join(', ')"/>
10+
<text args="address().street.join(', ')" if="address().street"/>
1111
<each args="data: address().customAttributes, as: 'element'">
1212
<div class="tig-billing-housenumber" if="element['attribute_code'] == 'tig_housenumber' || element['attribute_code'] == 'tig_housenumber_addition'">
1313
<text args="element.value"/>
@@ -24,7 +24,7 @@
2424
</div>
2525
</each>
2626

27-
<button visible="!address().isEditable()"
27+
<button visible="address().isEditable()"
2828
type="button"
2929
class="action edit-address-link"
3030
data-bind="click: editAddress, visible: address().isEditable()">

view/frontend/web/template/shipping-information/address-renderer/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<if args="visible()">
88
<text args="address().prefix"/> <text args="address().firstname"/> <text args="address().middlename"/>
99
<text args="address().lastname"/> <text args="address().suffix"/><br/>
10-
<text args="address().street.join(', ')"/>
10+
<text args="address().street.join(', ')" if="address().street"/>
1111
<each args="data: address().customAttributes, as: 'element'">
1212
<if args="element['attribute_code'] == 'tig_housenumber' || element['attribute_code'] == 'tig_housenumber_addition'">
1313
<text args="element.value"/>

0 commit comments

Comments
 (0)