WC_Stripe_Controller_Cart extends WC_Stripe_Rest_Controller uses WC_Stripe_Controller_Cart_Trait, WC_Stripe_Controller_Frontend_Trait

Controller class that perfors cart operations for client side requests.

Tags
author

PaymentPlugins

Table of Contents

Properties

$error  : WP_Error
$namespace  : mixed
$request  : WP_REST_Request

Methods

add_ready_to_calc_shipping()  : mixed
Method that hooks in to the woocommerce_cart_ready_to_calc_shipping filter.
add_to_cart()  : WP_REST_Response
admin_permission_check()  : mixed
cart_calculation()  : mixed
Performs a cart calculation
register_routes()  : mixed
Register all routes that the controller uses.
rest_uri()  : mixed
rest_url()  : mixed
update_shipping_address()  : mixed
update_shipping_method()  : mixed
Update the shipping method chosen by the customer.
validate_quantity()  : mixed
validate_rest_nonce()  : bool|WP_Error
validate_shipping_address()  : mixed
add_validation_error()  : mixed
Allows a status code of 200 to be returned even if there is a validation error.
cart_includes()  : mixed
empty_cart()  : void
frontend_includes()  : mixed
get_add_to_cart_args()  : array<string|int, mixed>
Return an array of arguments used to add a product to the cart.
get_error_messages()  : mixed
get_messages()  : mixed
get_supported_gateways()  : mixed
register_authenticated_route()  : mixed
clear_cached_shipping_rates()  : mixed
filtered_body_params()  : mixed
get_shipping_method_from_request()  : array<string|int, mixed>
has_shipping_methods()  : mixed
Return true if the provided packages have shipping methods.

Properties

Methods

add_ready_to_calc_shipping()

Method that hooks in to the woocommerce_cart_ready_to_calc_shipping filter.

public add_ready_to_calc_shipping() : mixed

Purpose is to ensure true is returned so shipping packages are calculated. Some 3rd party plugins and themes return false if the current page is the cart because they don't want to display the shipping calculator.

Tags
since
3.1.0

validate_shipping_address()

public validate_shipping_address(array<string|int, mixed> $address, WP_REST_Request $request) : mixed
Parameters
$address : array<string|int, mixed>
$request : WP_REST_Request

get_add_to_cart_args()

Return an array of arguments used to add a product to the cart.

protected get_add_to_cart_args(WP_REST_Request $request) : array<string|int, mixed>
Parameters
$request : WP_REST_Request
Tags
since
3.3.39
Return values
array<string|int, mixed>

get_shipping_method_from_request()

private get_shipping_method_from_request(WP_Rest_Request $request) : array<string|int, mixed>
Parameters
$request : WP_Rest_Request
Tags
since
3.1.8
throws
Exception
Return values
array<string|int, mixed>

        
On this page

Search results