parent
66c0d8f009
commit
f7e4bf224d
|
@ -40,7 +40,7 @@ jQuery( function( $ ) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( '1' !== wc_geolocation_params.is_checkout ) {
|
if ( '1' !== wc_geolocation_params.is_checkout && '1' !== wc_geolocation_params.is_cart && '1' !== wc_geolocation_params.is_account_page ) {
|
||||||
$.ajax( $geolocate_customer );
|
$.ajax( $geolocate_customer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class WC_Cache_Helper {
|
||||||
* This prevents caching of the wrong data for this request.
|
* This prevents caching of the wrong data for this request.
|
||||||
*/
|
*/
|
||||||
public static function geolocation_ajax_redirect() {
|
public static function geolocation_ajax_redirect() {
|
||||||
if ( 'geolocation_ajax' === get_option( 'woocommerce_default_customer_address' ) && ! is_checkout() && ! is_ajax() ) {
|
if ( 'geolocation_ajax' === get_option( 'woocommerce_default_customer_address' ) && ! is_checkout() && ! is_cart() && ! is_account_page() && ! is_ajax() && empty( $_POST ) ) {
|
||||||
$location_hash = self::geolocation_ajax_get_location_hash();
|
$location_hash = self::geolocation_ajax_get_location_hash();
|
||||||
$current_hash = isset( $_GET['v'] ) ? wc_clean( $_GET['v'] ) : '';
|
$current_hash = isset( $_GET['v'] ) ? wc_clean( $_GET['v'] ) : '';
|
||||||
if ( empty( $current_hash ) || $current_hash !== $location_hash ) {
|
if ( empty( $current_hash ) || $current_hash !== $location_hash ) {
|
||||||
|
|
|
@ -203,10 +203,12 @@ class WC_Frontend_Scripts {
|
||||||
break;
|
break;
|
||||||
case 'wc-geolocation' :
|
case 'wc-geolocation' :
|
||||||
return array(
|
return array(
|
||||||
'wc_ajax_url' => WC_AJAX::get_endpoint( "%%endpoint%%" ),
|
'wc_ajax_url' => WC_AJAX::get_endpoint( "%%endpoint%%" ),
|
||||||
'home_url' => home_url(),
|
'home_url' => home_url(),
|
||||||
'is_checkout' => is_checkout() ? '1' : '0',
|
'is_cart' => is_cart() ? '1' : '0',
|
||||||
'hash' => isset( $_GET['v'] ) ? wc_clean( $_GET['v'] ) : ''
|
'is_account_page' => is_account_page() ? '1' : '0',
|
||||||
|
'is_checkout' => is_checkout() ? '1' : '0',
|
||||||
|
'hash' => isset( $_GET['v'] ) ? wc_clean( $_GET['v'] ) : ''
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'wc-single-product' :
|
case 'wc-single-product' :
|
||||||
|
|
Loading…
Reference in New Issue