Min_Max_Quantity extends Abstract_Min_Max_Rule
Min Max Quantity Rules
Tags
Table of Contents
- $product : mixed
- $category_id : mixed
- $category_value : mixed
- $data_key : mixed
- $global_value : mixed
- $max : mixed
- $min : mixed
- $product_value : mixed
- $rule_level : mixed
- $rule_value : mixed
- $sanitize_cb : mixed
- $type : mixed
- $user_role_scope : mixed
- $variable_value : mixed
- $variation_value : mixed
- __construct() : mixed
- Constructor.
- calculate_rules() : mixed
- Calculate and set the rule value
- check_cart_validation() : bool
- Check if the qualifying total meets the rule conditions.
- get_cart_validation() : Cart_Validation|false
- Returns a cart validation for the rule based on the cart item key
- get_category_id() : int|null
- Get the category id
- get_category_value() : mixed
- Retrieves and sets the meta value at the category level
- get_data_key() : string
- Get the data key
- get_global_value() : mixed
- Retrieves and sets the meta value at the global level
- get_level() : string|null
- Returns the rule level
- get_max() : mixed
- Returns the max value
- get_min() : mixed
- Returns the min value
- get_product_value() : mixed
- Retrieves and sets the meta value at the product (simple) level
- get_qualifying_cart_total() : mixed
- Gets the qualifying cart total based on the rule level
- get_type() : string
- Get the type ID
- get_value() : mixed
- Returns the calculated rule value based on the rule level
- get_variable_value() : mixed
- Retrieves and sets the meta value at the variable level
- get_variation_value() : mixed
- Retrieves and sets the meta value at the variation level
- has_meta_value() : bool
- Checks the array based meta value exists
Properties
$product
public
mixed
$product
= null
Tags
$category_id
protected
mixed
$category_id
= null
Tags
$category_value
protected
mixed
$category_value
= null
Tags
$data_key
protected
mixed
$data_key
= null
Tags
$global_value
protected
mixed
$global_value
= null
Tags
$max
protected
mixed
$max
= null
Tags
$min
protected
mixed
$min
= null
Tags
$product_value
protected
mixed
$product_value
= null
Tags
$rule_level
protected
mixed
$rule_level
= null
Tags
$rule_value
protected
mixed
$rule_value
= null
Tags
$sanitize_cb
protected
mixed
$sanitize_cb
= ''
Tags
$type
protected
mixed
$type
= null
Tags
$user_role_scope
protected
mixed
$user_role_scope
= null
Tags
$variable_value
protected
mixed
$variable_value
= null
Tags
$variation_value
protected
mixed
$variation_value
= null
Tags
Methods
__construct()
Constructor.
public
__construct(WC_Product $product) : mixed
Parameters
- $product : WC_Product
Tags
Return values
mixed —calculate_rules()
Calculate and set the rule value
public
calculate_rules() : mixed
Tags
Return values
mixed —check_cart_validation()
Check if the qualifying total meets the rule conditions.
public
check_cart_validation(float $qualifying_total) : bool
Parameters
- $qualifying_total : float
Tags
Return values
bool —get_cart_validation()
Returns a cart validation for the rule based on the cart item key
public
get_cart_validation(WC_Cart $cart, string $cart_item_key) : Cart_Validation|false
Parameters
- $cart : WC_Cart
- $cart_item_key : string
Tags
Return values
Cart_Validation|false —get_category_id()
Get the category id
public
get_category_id() : int|null
Tags
Return values
int|null —get_category_value()
Retrieves and sets the meta value at the category level
public
get_category_value() : mixed
Tags
Return values
mixed —get_data_key()
Get the data key
public
get_data_key() : string
Tags
Return values
string —get_global_value()
Retrieves and sets the meta value at the global level
public
get_global_value() : mixed
Tags
Return values
mixed —get_level()
Returns the rule level
public
get_level() : string|null
Tags
Return values
string|null —get_max()
Returns the max value
public
get_max() : mixed
Tags
Return values
mixed —get_min()
Returns the min value
public
get_min() : mixed
Tags
Return values
mixed —get_product_value()
Retrieves and sets the meta value at the product (simple) level
public
get_product_value() : mixed
Tags
Return values
mixed —get_qualifying_cart_total()
Gets the qualifying cart total based on the rule level
public
get_qualifying_cart_total(WC_Cart $cart, string $cart_item_key) : mixed
Parameters
- $cart : WC_Cart
- $cart_item_key : string
Tags
Return values
mixed —get_type()
Get the type ID
public
get_type() : string
Tags
Return values
string —get_value()
Returns the calculated rule value based on the rule level
public
get_value() : mixed
Tags
Return values
mixed —get_variable_value()
Retrieves and sets the meta value at the variable level
public
get_variable_value() : mixed
Tags
Return values
mixed —get_variation_value()
Retrieves and sets the meta value at the variation level
public
get_variation_value() : mixed
Tags
Return values
mixed —has_meta_value()
Checks the array based meta value exists
protected
has_meta_value(mixed $value) : bool
Parameters
- $value : mixed