Automattic\WooCommerce\StoreApi\Utilities
AgenticCheckoutUtils::is_agentic_commerce_session
Whether the current request is within Agentic Commerce session.
Method of the class: AgenticCheckoutUtils{}
No Hooks.
Returns
true|false.
Usage
$result = AgenticCheckoutUtils::is_agentic_commerce_session(): bool;
AgenticCheckoutUtils::is_agentic_commerce_session() AgenticCheckoutUtils::is agentic commerce session code WC 10.4.3
public static function is_agentic_commerce_session(): bool {
$wc_session = WC()->session;
if ( null === $wc_session ) {
return false;
}
return ! empty( $wc_session->get( SessionKey::AGENTIC_CHECKOUT_SESSION_ID ) );
}