diff --git a/Test/Unit/Block/Adminhtml/Config/Support/TabTest.php b/Test/Unit/Block/Adminhtml/Config/Support/TabTest.php index fadb41c..acb1b82 100644 --- a/Test/Unit/Block/Adminhtml/Config/Support/TabTest.php +++ b/Test/Unit/Block/Adminhtml/Config/Support/TabTest.php @@ -51,7 +51,7 @@ public function testGetSupportedMagentoVersions() 'moduleConfiguration' => $this->getConfigurationMock() ]); - $this->assertSame('2.3.7-p1, 2.4.3', $instance->getSupportedMagentoVersions()); + $this->assertSame('2.3.7, 2.4.3', $instance->getSupportedMagentoVersions()); } /**+ @@ -62,7 +62,7 @@ private function getConfigurationMock() $mock = $this->getFakeMock(ModuleConfiguration::class)->getMock(); $mockExpects = $mock->expects($this->once()); $mockExpects->method('getSupportedMagentoVersions'); - $mockExpects->willReturn('2.3.7-p1, 2.4.3'); + $mockExpects->willReturn('2.3.7, 2.4.3'); return $mock; } diff --git a/etc/config.xml b/etc/config.xml index ba4ee7a..d2a25ee 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -33,7 +33,7 @@ - 2.3.7-p1, 2.4.3 + 2.3.7, 2.4.3 0 diff --git a/view/frontend/web/js/view/billing-address-mixin.js b/view/frontend/web/js/view/billing-address-mixin.js index 037e83a..7b92a16 100644 --- a/view/frontend/web/js/view/billing-address-mixin.js +++ b/view/frontend/web/js/view/billing-address-mixin.js @@ -40,12 +40,12 @@ define([ return function (Component) { return Component.extend({ tigHouseNumber: function () { - if (quote.billingAddress().customAttributes.length > 0) { + var customAttributes = quote.billingAddress().customAttributes; + + if (customAttributes && customAttributes.length > 0) { var houseNumber = ""; var houseNumberAddition = ""; - var customAttributes = quote.billingAddress().customAttributes; - // check if custom attribute exists and is not empty customAttributes.forEach(function (attribute) { if (attribute.attribute_code === "tig_housenumber" && attribute.value !== "") { diff --git a/view/frontend/web/js/view/form/fields.js b/view/frontend/web/js/view/form/fields.js index 5e77674..5d68bd4 100644 --- a/view/frontend/web/js/view/form/fields.js +++ b/view/frontend/web/js/view/form/fields.js @@ -97,33 +97,30 @@ define([ if (typeof options.data === "string") { var data = $.parseJSON(options.data); - // Handle Magento inconsistencies - var customAttributes = 'custom_attributes'; + if (data != null) { + // Handle Magento inconsistencies + var customAttributes = 'custom_attributes'; - if (!_.isUndefined(data.address) && !_.isUndefined(data.address[customAttributes])) { - data.address = this.addToAddress(data.address, customAttributes); - } + if (!_.isUndefined(data.address) && !_.isUndefined(data.address[customAttributes])) { + data.address = this.addToAddress(data.address, customAttributes); + } - customAttributes = 'customAttributes'; + customAttributes = 'customAttributes'; - if (!_.isUndefined(data.addressInformation) && data.addressInformation && - !_.isUndefined(data.addressInformation.shipping_address) && - !_.isUndefined(data.addressInformation.shipping_address[customAttributes])) { - data.addressInformation.shipping_address = this.addToAddress(data.addressInformation.shipping_address, customAttributes); - } + if (!_.isUndefined(data.addressInformation) && data.addressInformation && !_.isUndefined(data.addressInformation.shipping_address) && !_.isUndefined(data.addressInformation.shipping_address[customAttributes])) { + data.addressInformation.shipping_address = this.addToAddress(data.addressInformation.shipping_address, customAttributes); + } - if (!_.isUndefined(data.addressInformation) && data.addressInformation && - !_.isUndefined(data.addressInformation.billing_address) && - !_.isUndefined(data.addressInformation.billing_address[customAttributes])) { - data.addressInformation.billing_address = this.addToAddress(data.addressInformation.billing_address, customAttributes); - } + if (!_.isUndefined(data.addressInformation) && data.addressInformation && !_.isUndefined(data.addressInformation.billing_address) && !_.isUndefined(data.addressInformation.billing_address[customAttributes])) { + data.addressInformation.billing_address = this.addToAddress(data.addressInformation.billing_address, customAttributes); + } - if (!_.isUndefined(data.billingAddress) && data.billingAddress && - !_.isUndefined(data.billingAddress[customAttributes])) { - data.billingAddress = this.addToAddress(data.billingAddress, customAttributes); - } + if (!_.isUndefined(data.billingAddress) && data.billingAddress && !_.isUndefined(data.billingAddress[customAttributes])) { + data.billingAddress = this.addToAddress(data.billingAddress, customAttributes); + } - return JSON.stringify(data); + return JSON.stringify(data); + } } }, diff --git a/view/frontend/web/template/billing-address/details.html b/view/frontend/web/template/billing-address/details.html index 6440e0b..9df1791 100644 --- a/view/frontend/web/template/billing-address/details.html +++ b/view/frontend/web/template/billing-address/details.html @@ -7,7 +7,7 @@

- +
,

diff --git a/view/frontend/web/template/shipping-address/address-renderer/default.html b/view/frontend/web/template/shipping-address/address-renderer/default.html index 5549e2d..63cae04 100644 --- a/view/frontend/web/template/shipping-address/address-renderer/default.html +++ b/view/frontend/web/template/shipping-address/address-renderer/default.html @@ -7,7 +7,7 @@

- +
@@ -24,7 +24,7 @@
-