Cart_Handler implements Registerable, Standard_Service

Cart Pricing Handler

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

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

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

register()

{@inheritdoc}

public register() : mixed
Tags
Return values
mixed

Search results