Default_Quantity extends Abstract_Rule
Default Quantity
Tags
Table of Contents
- $product : mixed
- $category_id : mixed
- $category_value : mixed
- $data_key : mixed
- $global_value : 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 the qualifying total meets the rule conditions,
- get_cart_validation() : Cart_Validation|false
- Get a Cart_Validation object.
- 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_product_value() : mixed
- Retrieves and sets the meta value at the product (simple) 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
- Determines if a given meta value is empty
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
$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 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()
Get a Cart_Validation object.
    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_product_value()
Retrieves and sets the meta value at the product (simple) level
    public
                get_product_value() : mixed
    
    
    
    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()
Determines if a given meta value is empty
    protected
                has_meta_value(mixed $value) : bool
    
        Parameters
- $value : mixed