File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
view/frontend/web/js/action Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,18 @@ define(
4747 /** start loader */
4848 loader . startLoader ( ) ;
4949
50- /** change browser url */
50+ /** fix load page FPC */
51+ const url = new URL ( window . location ) ;
52+ url . href = submitUrl ;
53+ if ( url . searchParams . get ( 'mpLayer' ) ) {
54+ url . searchParams . delete ( 'mpLayer' ) ;
55+ window . history . pushState ( { } , '' , url ) ;
56+ }
57+ /** change browser url */
5158 if ( typeof window . history . pushState === 'function' && ( typeof isChangeUrl === 'undefined' ) ) {
52- window . history . pushState ( { url : submitUrl } , '' , submitUrl ) ;
59+ window . history . pushState ( { url : submitUrl } , '' , url . href ) ;
5360 }
61+
5462 if ( method === 'post' ) { // For 'add to wishlist' & 'add to compare' event
5563 return storage . post ( submitUrl ) . done (
5664 ) . fail (
@@ -62,7 +70,7 @@ define(
6270 } ) ;
6371 }
6472
65- return storage . get ( submitUrl ) . done (
73+ return $ . get ( { url : submitUrl , cache : true } , { 'mpLayer' : 1 } ) . done (
6674 function ( response ) {
6775 if ( response . backUrl ) {
6876 window . location = response . backUrl ;
You can’t perform that action at this time.
0 commit comments