Add_To_Cart
in package
implements
Registerable, Service
Add to Cart Handler
Tags
Interfaces, Classes and Traits
- Registerable
- An object that can be registered with WordPress via the Plugin API, i.e. add_action() and add_filter().
- Service
- Marker interface to denote a service.
Table of Contents
- handle_validation() : bool
- Handles validation on add to cart.
- register() : mixed
Methods
handle_validation()
Handles validation on add to cart.
public
handle_validation(bool $passed, int $product_id, int $quantity[, int|null $variation_id = null ][, WC_Product_Variation $variation = null ]) : bool
A test cart is cloned to determine which rules the product would break if it is added to the cart.
Parameters
- $passed : bool
- $product_id : int
- $quantity : int
- $variation_id : int|null = null
- $variation : WC_Product_Variation = null
Return values
bool —$passed
register()
public
register() : mixed