File tree 2 files changed +15
-1
lines changed
app/code/Magento/Checkout/view/frontend/web/js
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,15 @@ define([
182
182
} ) ;
183
183
} ,
184
184
185
+ /**
186
+ * Sets window location hash.
187
+ *
188
+ * @param {String } hash
189
+ */
190
+ setHash : function ( hash ) {
191
+ window . location . hash = hash ;
192
+ } ,
193
+
185
194
/**
186
195
* Next step.
187
196
*/
@@ -199,7 +208,7 @@ define([
199
208
if ( steps ( ) . length > activeIndex + 1 ) {
200
209
code = steps ( ) [ activeIndex + 1 ] . code ;
201
210
steps ( ) [ activeIndex + 1 ] . isVisible ( true ) ;
202
- window . location = window . checkoutConfig . checkoutUrl + '#' + code ;
211
+ this . setHash ( code ) ;
203
212
document . body . scrollTop = document . documentElement . scrollTop = 0 ;
204
213
}
205
214
}
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ define([
26
26
initialize : function ( ) {
27
27
this . _super ( ) ;
28
28
$ ( window ) . hashchange ( _ . bind ( stepNavigator . handleHash , stepNavigator ) ) ;
29
+
30
+ if ( ! window . location . hash ) {
31
+ stepNavigator . setHash ( stepNavigator . steps ( ) . sort ( stepNavigator . sortItems ) [ 0 ] . code ) ;
32
+ }
33
+
29
34
stepNavigator . handleHash ( ) ;
30
35
} ,
31
36
You can’t perform that action at this time.
0 commit comments