Skip to content

Commit 4b73a0f

Browse files
committed
MAGETWO-34253: CLONE - Postal code is still mandatory for Non-US addresses that don't use it
- Fixed code style
1 parent 087fd8d commit 4b73a0f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

app/code/Magento/Directory/Model/Resource/Country/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function toOptionArray($emptyLabel = ' ')
219219
foreach ($sort as $label => $value) {
220220
$option = ['value' => $value, 'label' => $label];
221221
if ($this->helperData->isRegionRequired($value)) {
222-
$option['is_region_required'] = 'true';
222+
$option['is_region_required'] = true;
223223
}
224224
$options[] = $option;
225225
}

app/code/Magento/Ui/view/base/web/js/form/element/post-code.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ define([
1515
*
1616
* @return {this}
1717
*/
18-
initListeners: function(){
18+
initListeners: function () {
1919
this._super()
2020
.update()
21-
.provider.data.on('update:'+this.parentScope+'.country_id', this.update.bind(this));
21+
.provider.data.on('update:' + this.parentScope + '.country_id', this.update.bind(this));
2222

2323
return this;
2424
},
@@ -30,8 +30,8 @@ define([
3030
*
3131
* @returns {this}
3232
*/
33-
update: function(){
34-
var parentScope = this.getPart(this.getPart(this.name, -2), -2),
33+
update: function () {
34+
var parentScope = this.getPart(this.getPart(this.name, -2), -2),
3535
option,
3636
postcode = this;
3737

@@ -46,10 +46,11 @@ define([
4646
.options()
4747
.some(function (el) {
4848
option = el;
49+
4950
return el.value === value;
5051
});
5152

52-
if(!option.is_region_required) {
53+
if (!option.is_region_required) {
5354
postcode.error(false);
5455
postcode.validation = _.omit(postcode.validation, 'required-entry');
5556
} else {
@@ -61,4 +62,4 @@ define([
6162
return this;
6263
}
6364
});
64-
});
65+
});

0 commit comments

Comments
 (0)