\Barn2\Plugin\WC_Quick_View_Pro\RestAdd_To_Cart_Route

REST handler for the 'add to cart' route.

Summary

Methods
Properties
Constants
add_to_cart()
No public properties found
No constants found
add_products_to_cart()
add_single_product_to_cart()
format_woocommerce_notice()
get_add_to_cart_message()
validate_add_to_cart_params()
No protected properties found
N/A
check_prerequisites()
get_add_to_cart_fragments()
get_add_to_cart_hash()
get_submitted_variations()
wrap_woocommerce_notice()
No private properties found
N/A

Methods

add_to_cart()

add_to_cart(\WP_REST_Request  $request)

Parameters

\WP_REST_Request $request

add_products_to_cart()

add_products_to_cart(  $params)

Parameters

$params

add_single_product_to_cart()

add_single_product_to_cart(  $product_id,  $quantity,  $variation_id,  $variations = array())

Parameters

$product_id
$quantity
$variation_id
$variations

format_woocommerce_notice()

format_woocommerce_notice(  $messages,  $type = 'sucess')

Parameters

$messages
$type

get_add_to_cart_message()

get_add_to_cart_message(integer|array  $products,boolean  $show_qty = false): mixed

Custom add to cart message for the Quick View.

Parameters

integer|array $products

Product ID list or single product ID.

boolean $show_qty

Should qty's be shown? Added in 2.6.0.

Returns

mixed

validate_add_to_cart_params()

validate_add_to_cart_params(  $params)

Parameters

$params

check_prerequisites()

check_prerequisites()

Check any prerequisites required for our add to cart request.

get_add_to_cart_fragments()

get_add_to_cart_fragments()

get_add_to_cart_hash()

get_add_to_cart_hash()

get_submitted_variations()

get_submitted_variations(  $params,  $product)

Parameters

$params
$product

wrap_woocommerce_notice()

wrap_woocommerce_notice(  $notice)

Parameters

$notice