WooCommerce Code Reference

Search results

WC_Form_Handler

WC_Form_Handler class.

Table of Contents

init() Hook in methods. mixed
redirect_reset_password_link() Remove key and user ID (or user login, as a fallback) from query string, set cookie, and redirect to account page to show the form. mixed
save_address() Save and and update a billing or shipping address if the form was submitted through the user account page. mixed
save_account_details() Save the password/account details and redirect back to the my account page. mixed
checkout_action() Process the checkout form. mixed
pay_action() Process the pay form. mixed
add_payment_method_action() Process the add payment method form. mixed
delete_payment_method_action() Process the delete payment method form. mixed
set_default_payment_method_action() Process the delete payment method form. mixed
update_cart_action() Remove from cart/update. mixed
order_again() Place a previous order again. mixed
cancel_order() Cancel a pending order. mixed
add_to_cart_action() Add to cart action. mixed
add_to_cart_handler_simple() Handle adding simple products to the cart. bool
add_to_cart_handler_grouped() Handle adding grouped products to the cart. bool
add_to_cart_handler_variable() Handle adding variable products to the cart. bool
process_login() Process the login form. mixed
process_lost_password() Handle lost password form. mixed
process_reset_password() Handle reset password form. mixed
process_registration() Process the registration form. mixed

Methods

redirect_reset_password_link()

Remove key and user ID (or user login, as a fallback) from query string, set cookie, and redirect to account page to show the form.

public static redirect_reset_password_link( ) : mixed
Return values
mixed

save_address()

Save and and update a billing or shipping address if the form was submitted through the user account page.

public static save_address( ) : mixed
Return values
mixed

save_account_details()

Save the password/account details and redirect back to the my account page.

public static save_account_details( ) : mixed
Return values
mixed

checkout_action()

Process the checkout form.

public static checkout_action( ) : mixed
Return values
mixed

pay_action()

Process the pay form.

public static pay_action( ) : mixed
Tags
throws

On payment error.

Return values
mixed

add_payment_method_action()

Process the add payment method form.

public static add_payment_method_action( ) : mixed
Return values
mixed

delete_payment_method_action()

Process the delete payment method form.

public static delete_payment_method_action( ) : mixed
Return values
mixed

set_default_payment_method_action()

Process the delete payment method form.

public static set_default_payment_method_action( ) : mixed
Return values
mixed

update_cart_action()

Remove from cart/update.

public static update_cart_action( ) : mixed
Return values
mixed

order_again()

Place a previous order again.

public static order_again( ) : mixed
Tags
deprecated

Logic moved to cart session handling.

Return values
mixed

cancel_order()

Cancel a pending order.

public static cancel_order( ) : mixed
Return values
mixed

add_to_cart_action()

Add to cart action.

public static add_to_cart_action( [ $url : bool = false ] ) : mixed

Checks for a valid request, does validation (via hooks) and then redirects if valid.

Parameters
$url : bool = false

(default: false) URL to redirect to.

Return values
mixed

add_to_cart_handler_simple()

Handle adding simple products to the cart.

private static add_to_cart_handler_simple( $product_id : int ) : bool
Parameters
$product_id : int

Product ID to add to the cart.

Tags
since

Split from add_to_cart_action.

Return values
bool

success or not

add_to_cart_handler_grouped()

Handle adding grouped products to the cart.

private static add_to_cart_handler_grouped( $product_id : int ) : bool
Parameters
$product_id : int

Product ID to add to the cart.

Tags
since

Split from add_to_cart_action.

Return values
bool

success or not

add_to_cart_handler_variable()

Handle adding variable products to the cart.

private static add_to_cart_handler_variable( $product_id : int ) : bool
Parameters
$product_id : int

Product ID to add to the cart.

Tags
since

Split from add_to_cart_action.

throws

If add to cart fails.

Return values
bool

success or not

process_login()

Process the login form.

public static process_login( ) : mixed
Tags
throws

On login error.

Return values
mixed

process_lost_password()

Handle lost password form.

public static process_lost_password( ) : mixed
Return values
mixed

process_reset_password()

Handle reset password form.

public static process_reset_password( ) : mixed
Return values
mixed

process_registration()

Process the registration form.

public static process_registration( ) : mixed
Tags
throws

On registration error.

Return values
mixed
Back to the top