Merged in feature/MAW-855-import-code-into-aws (pull request #2)

code import from pantheon

* code import from pantheon
This commit is contained in:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -83,17 +83,14 @@ jQuery( function( $ ) {
// Updates our (cookie-based) cache of the hash value. Expires in 1 hour.
Cookies.set( 'woocommerce_geo_hash', hash, { expires: 1 / 24 } );
var this_page = window.location.toString();
const urlQuery = new URL( window.location ).searchParams;
const existingHash = urlQuery.get( 'v' );
if ( this_page.indexOf( '?v=' ) > 0 || this_page.indexOf( '&v=' ) > 0 ) {
this_page = this_page.replace( /v=[^&]+/, 'v=' + hash );
} else if ( this_page.indexOf( '?' ) > 0 ) {
this_page = this_page + '&v=' + hash;
} else {
this_page = this_page + '?v=' + hash;
// If the current URL does not contain the expected hash, redirect.
if ( existingHash !== hash ) {
urlQuery.set( 'v', hash );
window.location.search = '?' + urlQuery.toString();
}
window.location = this_page;
};
/**