Skip to content

Commit 66d3829

Browse files
author
Oleksandr Dubovyk
committed
Merge remote-tracking branch 'mpi/MC-38846' into PR17november
2 parents 4e32711 + b0aaa76 commit 66d3829

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ define([
2727
// clone address form data to new object
2828
var addressData = $.extend(true, {}, formData),
2929
region,
30-
regionName = addressData.region;
30+
regionName = addressData.region,
31+
customAttributes;
3132

3233
if (mageUtils.isObject(addressData.street)) {
3334
addressData.street = this.objectToArray(addressData.street);
@@ -64,10 +65,20 @@ define([
6465
addressData['custom_attributes'] = _.map(
6566
addressData['custom_attributes'],
6667
function (value, key) {
67-
return {
68+
customAttributes = {
6869
'attribute_code': key,
6970
'value': value
7071
};
72+
73+
if (typeof value === 'boolean') {
74+
customAttributes = {
75+
'attribute_code': key,
76+
'value': value,
77+
'label': value === true ? 'Yes' : 'No'
78+
};
79+
}
80+
81+
return customAttributes;
7182
}
7283
);
7384
}

app/code/Magento/Customer/Model/Address/CustomAttributesProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private function getAttributeLabels(array $customAttribute, string $customAttrib
7171
{
7272
$attributeOptionLabels = [];
7373

74-
if (!empty($customAttribute['value'])) {
74+
if (isset($customAttribute['value']) && $customAttribute['value'] != null) {
7575
$customAttributeValues = explode(',', $customAttribute['value']);
7676
$attributeOptions = $this->attributeOptionManager->getItems(
7777
\Magento\Customer\Model\Indexer\Address\AttributeProvider::ENTITY,

0 commit comments

Comments
 (0)