Cart_Handler implements Registerable, Standard_Service
Cart Pricing Handler
Tags
Interfaces, Classes and Traits
- Registerable
- Standard_Service
Table of Contents
- $role : Wholesale_Role
- The role of the current user
- calculate_wholesale_price() : string
- Calculate the cart item price based on the current user
- cart_calculate() : mixed
- Calculates the wholesale price inside the cart.
- cart_item_price() : string
- Filter the cart item price for the mini cart
- get_role() : Wholesale_Role
- Get the wholesale role for the current user.
- register() : mixed
- {@inheritdoc}
- set_role() : self
- Set the wholesale role for the current user.
Properties
$role
The role of the current user
private
Wholesale_Role
$role
Tags
Methods
calculate_wholesale_price()
Calculate the cart item price based on the current user
public
calculate_wholesale_price(array<string|int, mixed> $cart_item) : string
Parameters
- $cart_item : array<string|int, mixed>
-
The cart item.
Tags
Return values
string —cart_calculate()
Calculates the wholesale price inside the cart.
public
cart_calculate(WC_Cart $cart) : mixed
Parameters
- $cart : WC_Cart
Tags
Return values
mixed —cart_item_price()
Filter the cart item price for the mini cart
public
cart_item_price(string $price, array<string|int, mixed> $cart_item) : string
Parameters
- $price : string
- $cart_item : array<string|int, mixed>
Tags
Return values
string —get_role()
Get the wholesale role for the current user.
public
get_role() : Wholesale_Role
Tags
Return values
Wholesale_Role —register()
{@inheritdoc}
public
register() : mixed
Tags
Return values
mixed —set_role()
Set the wholesale role for the current user.
public
set_role(Wholesale_Role $role) : self
Parameters
- $role : Wholesale_Role
-
The role of the current user.