WooCommerce Code Reference

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_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.

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

Process the query params and return the checkout link to redirect to complete with session token.

protected get_checkout_link() : string
Return values
stringThe 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 the checkout link.

protected validate_checkout_link() : bool
Return values
boolTrue if the checkout link is valid, false otherwise.