Fix for compatibility with WPML
With WPML, query parameter lang is added on home_url which means that geolocalization.min.js will not find any href with that query parameter. We need to remove this parameter from the home_url, otherwise it will not match the regex for the query in the JS function.
This commit is contained in:
parent
c88396cd4c
commit
c32b95579a
|
@ -464,7 +464,7 @@ class WC_Frontend_Scripts {
|
||||||
case 'wc-geolocation':
|
case 'wc-geolocation':
|
||||||
$params = array(
|
$params = array(
|
||||||
'wc_ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ),
|
'wc_ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ),
|
||||||
'home_url' => home_url(),
|
'home_url' => remove_query_arg( 'lang' , home_url() ),
|
||||||
'is_available' => ! ( is_cart() || is_account_page() || is_checkout() || is_customize_preview() ) ? '1' : '0',
|
'is_available' => ! ( is_cart() || is_account_page() || is_checkout() || is_customize_preview() ) ? '1' : '0',
|
||||||
'hash' => isset( $_GET['v'] ) ? wc_clean( wp_unslash( $_GET['v'] ) ) : '', // WPCS: input var ok, CSRF ok.
|
'hash' => isset( $_GET['v'] ) ? wc_clean( wp_unslash( $_GET['v'] ) ) : '', // WPCS: input var ok, CSRF ok.
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue