File tree Expand file tree Collapse file tree 5 files changed +29
-10
lines changed
Checkout/view/frontend/web/js/model
frontend/web/templates/form Expand file tree Collapse file tree 5 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -81,13 +81,14 @@ define(
81
81
var countryId = $ ( 'select[name="shippingAddress[country_id]"]' ) . val ( ) ;
82
82
var validationResult = postcodeValidator . validate ( postcodeElement . value ( ) , countryId ) ;
83
83
84
- postcodeElement . error ( null ) ;
84
+ postcodeElement . warn ( null ) ;
85
85
if ( ! validationResult ) {
86
- var errorMessage = $t ( 'Invalid Zip/Postal code for current country! ' ) ;
86
+ var warnMessage = $t ( 'Provided Zip/Postal Code seems to be invalid. ' ) ;
87
87
if ( postcodeValidator . validatedPostCodeExample . length ) {
88
- errorMessage += $t ( ' Example: ' ) + postcodeValidator . validatedPostCodeExample . join ( '; ' ) ;
88
+ warnMessage += $t ( ' Example: ' ) + postcodeValidator . validatedPostCodeExample . join ( '; ' ) + '. ' ;
89
89
}
90
- postcodeElement . error ( errorMessage ) ;
90
+ warnMessage += $t ( 'If you believe it is the right one you can ignore this notice.' ) ;
91
+ postcodeElement . warn ( warnMessage ) ;
91
92
}
92
93
return validationResult ;
93
94
} ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ define([
25
25
description : '' ,
26
26
label : '' ,
27
27
error : '' ,
28
+ warn : '' ,
28
29
notice : '' ,
29
30
customScope : '' ,
30
31
additionalClasses : { } ,
@@ -64,7 +65,7 @@ define([
64
65
65
66
this . _super ( ) ;
66
67
67
- this . observe ( 'error disabled focused preview visible value' )
68
+ this . observe ( 'error disabled focused preview visible value warn ' )
68
69
. observe ( {
69
70
'required' : ! ! rules [ 'required-entry' ]
70
71
} ) ;
@@ -126,6 +127,7 @@ define([
126
127
_ . extend ( this . additionalClasses , {
127
128
required : this . required ,
128
129
_error : this . error ,
130
+ _warn : this . warn ,
129
131
_disabled : this . disabled
130
132
} ) ;
131
133
Original file line number Diff line number Diff line change 42
42
<!-- ko if: element.error() -->
43
43
< div class ="mage-error " data-bind ="attr: { for: element.uid }, text: element.error " generated ="true "> </ div >
44
44
<!-- /ko -->
45
+
46
+ <!-- ko if: element.warn() -->
47
+ < div class ="message warning " generated ="true "> < span data-bind ="text: element.warn "> </ span > </ div >
48
+ <!-- /ko -->
45
49
</ div >
46
50
</ div >
47
51
<!-- /ko -->
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ fieldset.field {
70
70
white-space : nowrap ;
71
71
}
72
72
}
73
+ .message {
74
+ & .warning {
75
+ margin-top : @indent__s ;
76
+ }
77
+ }
73
78
}
74
79
75
80
div .mage-error [generated] {
Original file line number Diff line number Diff line change @@ -59,11 +59,18 @@ fieldset.field {
59
59
border : 0 ;
60
60
padding : 0 ;
61
61
}
62
- .field.date {
63
- .time-picker {
64
- white-space : nowrap ;
65
- margin-top : @indent__s ;
66
- display : inline-block ;
62
+ .field {
63
+ & .date {
64
+ .time-picker {
65
+ white-space : nowrap ;
66
+ margin-top : @indent__s ;
67
+ display : inline-block ;
68
+ }
69
+ }
70
+ .message {
71
+ & .warning {
72
+ margin-top : @indent__s ;
73
+ }
67
74
}
68
75
}
69
76
You can’t perform that action at this time.
0 commit comments