Skip to content

Commit 017c529

Browse files
authored
Merge pull request #253 from vtex-apps/fix/ita-number
fix: Italian number when using custom address form
2 parents 4863717 + 7608d3f commit 017c529

File tree

5 files changed

+53
-9
lines changed

5 files changed

+53
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Italian number when using custom address form
13+
1014
## [0.18.8] - 2024-07-23
1115

1216
### Fixed

checkout-ui-custom/checkout6-custom.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

checkout-ui-custom/src/_js/_countries.js

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,53 @@
11
module.exports._countriesrules = {
22
ITA: {
3+
postalCode: {
4+
valueIn: "long_name",
5+
types: [
6+
"postal_code"
7+
],
8+
required: false
9+
},
10+
number: {
11+
valueIn: "long_name",
12+
types: [
13+
"street_number"
14+
],
15+
required: true,
16+
notApplicable: true
17+
},
18+
street: {
19+
valueIn: "long_name",
20+
types: [
21+
"route"
22+
]
23+
},
24+
neighborhood: {
25+
valueIn: "long_name",
26+
types: [
27+
"neighborhood",
28+
"sublocality_level_1",
29+
"sublocality_level_2",
30+
"sublocality_level_3",
31+
"sublocality_level_4",
32+
"sublocality_level_5"
33+
]
34+
},
335
state: {
4-
valueIn: 'short_name',
5-
types: ['administrative_area_level_2'],
36+
valueIn: "short_name",
37+
types: [
38+
"administrative_area_level_2"
39+
]
640
},
741
city: {
8-
valueIn: 'long_name',
9-
types: ['locality'],
42+
valueIn: "long_name",
43+
types: [
44+
"administrative_area_level_3",
45+
"locality"
46+
]
1047
},
11-
number: true,
12-
postalCode: true,
48+
receiverName: {
49+
required: true
50+
}
1351
},
1452
GBR: {
1553
state: {

checkout-ui-custom/src/_js/_customAddressForm.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ class fnsCustomAddressForm {
459459
// temporaly workaround for USA and CAN
460460
if (
461461
_country === 'USA' ||
462-
_country === 'ITA' ||
463462
_country === 'MLT' ||
464463
_country === 'CAN'
465464
) {
@@ -1130,6 +1129,9 @@ class fnsCustomAddressForm {
11301129
if (country == 'MLT') {
11311130
return _countriesrules.MLT
11321131
}
1132+
if (country == 'ITA') {
1133+
return _countriesrules.ITA
1134+
}
11331135

11341136
return success ? rules.geolocation : _this.getCountryRule('default')
11351137
})

node/templates/checkout6-custom.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)