WC_Session_Handler::maybe_set_customer_session_cookiepublicWC 1.0

Hooks into the wp action to maybe set the session cookie if the user is on a certain page e.g. a checkout endpoint.

Certain gateways may rely on sessions and this ensures a session is present even if the customer does not have a cart.

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

Хуков нет.

Возвращает

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

Использование

$WC_Session_Handler = new WC_Session_Handler();
$WC_Session_Handler->maybe_set_customer_session_cookie();

Код WC_Session_Handler::maybe_set_customer_session_cookie() WC 10.7.0

public function maybe_set_customer_session_cookie() {
	if ( is_wc_endpoint_url( 'order-pay' ) ) {
		$this->set_customer_session_cookie( true );
	}
}