Skip to content

Woocommerce - Remove geolocation QS from esi requests #708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions thirdparty/woocommerce.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ public function add_hooks() {
return array_unique($list);
});
}

// #612331 - remove Woocommerce geolocation redirect on ESI page
$class_esi = $this->cls('ESI');
$link_action = $class_esi::QS_ACTION;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timotei-litespeed there is no need to init ESI class to get the class consts. Please notice it.
Besides, I believe this is ESI only, so should be put to L87.
I will give the commit for it.

$link_param = $class_esi::QS_PARAMS;
if (!empty($_GET[$link_action]) && !empty($_GET[$link_param])) {
remove_action( 'template_redirect', array( 'WC_Cache_Helper', 'geolocation_ajax_redirect' ), 10 );
}
}

/**
Expand Down