WC_Cache_Helper::update_geolocation_hash()public staticWC 1.0

Updates the woocommerce_geo_hash cookie, which is used to help ensure we display the correct pricing etc to customers, according to their billing country.

Note that:

A) This only sets the cookie if the default customer address is set to "Geolocate (with

Page Caching Support)".

B) It is hooked into the wc_ajax_update_order_review action, which has the benefit of

ensuring we update the cookie any time the billing country is changed.

Метод класса: WC_Cache_Helper{}

Хуков нет.


null. Ничего (null).


$result = WC_Cache_Helper::update_geolocation_hash();

Код WC_Cache_Helper::update_geolocation_hash() WC 8.9.3

public static function update_geolocation_hash() {
	if ( 'geolocation_ajax' === get_option( 'woocommerce_default_customer_address' ) ) {
		wc_setcookie( 'woocommerce_geo_hash', static::geolocation_ajax_get_location_hash(), time() + HOUR_IN_SECONDS );