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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class WC_Cache_Helper {
|
|||
* This prevents caching of the wrong data for this request.
|
||||
*/
|
||||
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();
|
||||
$current_hash = isset( $_GET['v'] ) ? wc_clean( $_GET['v'] ) : '';
|
||||
if ( empty( $current_hash ) || $current_hash !== $location_hash ) {
|
||||
|
|
|
@ -205,6 +205,8 @@ class WC_Frontend_Scripts {
|
|||
return array(
|
||||
'wc_ajax_url' => WC_AJAX::get_endpoint( "%%endpoint%%" ),
|
||||
'home_url' => home_url(),
|
||||
'is_cart' => is_cart() ? '1' : '0',
|
||||
'is_account_page' => is_account_page() ? '1' : '0',
|
||||
'is_checkout' => is_checkout() ? '1' : '0',
|
||||
'hash' => isset( $_GET['v'] ) ? wc_clean( $_GET['v'] ) : ''
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue