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:
Miguel Pinto 2019-09-20 10:33:19 +01:00 committed by Gerhard
parent c88396cd4c
commit c32b95579a
1 changed files with 1 additions and 1 deletions

View File

@ -464,7 +464,7 @@ class WC_Frontend_Scripts {
case 'wc-geolocation':
$params = array(
'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',
'hash' => isset( $_GET['v'] ) ? wc_clean( wp_unslash( $_GET['v'] ) ) : '', // WPCS: input var ok, CSRF ok.
);