diff -Nuar a/vendor/magento/module-checkout/view/frontend/web/js/model/address-converter.js b/vendor/magento/module-checkout/view/frontend/web/js/model/address-converter.js index a59ea7101f1..d296999c88b 100644 --- a/vendor/magento/module-checkout/view/frontend/web/js/model/address-converter.js +++ b/vendor/magento/module-checkout/view/frontend/web/js/model/address-converter.js @@ -27,7 +27,8 @@ define([ // clone address form data to new object var addressData = $.extend(true, {}, formData), region, - regionName = addressData.region; + regionName = addressData.region, + customAttributes; if (mageUtils.isObject(addressData.street)) { addressData.street = this.objectToArray(addressData.street); @@ -64,10 +65,20 @@ define([ addressData['custom_attributes'] = _.map( addressData['custom_attributes'], function (value, key) { - return { + customAttributes = { 'attribute_code': key, 'value': value }; + + if (typeof value === 'boolean') { + customAttributes = { + 'attribute_code': key, + 'value': value, + 'label': value === true ? 'Yes' : 'No' + }; + } + + return customAttributes; } ); } diff -Nuar a/vendor/magento/module-customer/Model/Address/CustomAttributesProcessor.php b/vendor/magento/module-customer/Model/Address/CustomAttributesProcessor.php index d6e63e11ee4..0fd72a59189 100644 --- a/vendor/magento/module-customer/Model/Address/CustomAttributesProcessor.php +++ b/vendor/magento/module-customer/Model/Address/CustomAttributesProcessor.php @@ -71,7 +71,7 @@ class CustomAttributesProcessor { $attributeOptionLabels = []; - if (!empty($customAttribute['value'])) { + if (isset($customAttribute['value']) && $customAttribute['value'] != null) { $customAttributeValues = explode(',', $customAttribute['value']); $attributeOptions = $this->attributeOptionManager->getItems( \Magento\Customer\Model\Indexer\Address\AttributeProvider::ENTITY,