CheckoutLink
in package
Checkout Link class.
Table of Contents
- add_checkout_link_endpoint() : mixed
- Add the checkout link endpoint.
- add_query_vars() : array<string|int, mixed>
- Add the checkout link query var.
- handle_checkout_link_endpoint() : void
- Handle the checkout link endpoint.
- init() : mixed
- Initialize the checkout link service.
- add_error_notices() : void
- Add error notices to the cart.
- get_checkout_link() : string
- Process the query params and return the checkout link to redirect to complete with session token.
- get_products_from_checkout_link() : array<string|int, mixed>
- Get the products from the checkout link.
- validate_checkout_link() : bool
- Validate the checkout link.
Methods
add_checkout_link_endpoint()
Add the checkout link endpoint.
public
add_checkout_link_endpoint() : mixed
Return values
mixed —add_query_vars()
Add the checkout link query var.
public
add_query_vars(array<string|int, mixed> $vars) : array<string|int, mixed>
Parameters
- $vars : array<string|int, mixed>
-
The query vars.
Return values
array<string|int, mixed> — The query vars.handle_checkout_link_endpoint()
Handle the checkout link endpoint.
public
handle_checkout_link_endpoint() : void
Return values
void —init()
Initialize the checkout link service.
public
init() : mixed
Return values
mixed —add_error_notices()
Add error notices to the cart.
protected
add_error_notices(WP_Error $errors) : void
Parameters
- $errors : WP_Error
-
The errors.
Return values
void —get_checkout_link()
Process the query params and return the checkout link to redirect to complete with session token.
protected
get_checkout_link() : string
Return values
string — The checkout link.get_products_from_checkout_link()
Get the products from the checkout link.
protected
get_products_from_checkout_link() : array<string|int, mixed>
Return values
array<string|int, mixed> — The products (keys) and their quantities (values).validate_checkout_link()
Validate the checkout link.
protected
validate_checkout_link() : bool