AgenticCheckoutSession
in package
AgenticCheckoutSession class.
Wrapper for all things, associated with an agentic checkout session. This class manages the cart and error handling for agentic checkout processes.
Table of Contents
- $cart : WC_Cart
- The WooCommerce cart instance.
- $id : string
- The checkout session ID.
- $messages : Messages
- Error messages handler for the checkout session.
- __construct() : mixed
- Constructor.
- get_cart() : WC_Cart
- Gets the cart instance.
- get_id() : string
- Gets the checkout session ID.
- get_messages() : Messages
- Gets the messages collection.
- get_or_set_checkout_session_id() : string
- Get the checkout session ID. If it does not exist, generate a cart token for it and save to the current session.
Properties
$cart
The WooCommerce cart instance.
private
WC_Cart
$cart
$id
The checkout session ID.
private
string
$id
$messages
Error messages handler for the checkout session.
private
Messages
$messages
Methods
__construct()
Constructor.
public
__construct(WC_Cart $cart) : mixed
Parameters
- $cart : WC_Cart
-
The WooCommerce cart instance.
Return values
mixed —get_cart()
Gets the cart instance.
public
get_cart() : WC_Cart
Return values
WC_Cart — The WooCommerce cart instance.get_id()
Gets the checkout session ID.
public
get_id() : string
Return values
string — The checkout session ID.get_messages()
Gets the messages collection.
public
get_messages() : Messages
Return values
Messages — The messages handler instance.get_or_set_checkout_session_id()
Get the checkout session ID. If it does not exist, generate a cart token for it and save to the current session.
private
get_or_set_checkout_session_id() : string
