BasketTotal
in package
Uses ElementTrait, TotalsTrait

This is the basket total class.

The basket totals information will be stored in that class and will remain immutable (only get methods are available)

Tags
see
BasketTotal::getTotalRows()
see
BasketTotal::getTotalShippings()
see
BasketTotal::getTotalPaymentSystem()
see
BasketTotal::getSubtotalRows()
see
BasketTotal::getSubtotalShippings()
see
BasketTotal::getSubtotalPaymentSystem()
see
BasketTotal::getSubtotal()
see
BasketTotal::getTotalQuantity()
see
ElementTrait
see
TotalsTrait

Table of Contents

__construct() Elements constructor.  : mixed
__toString() Uses "json_encode" function to return the JSON format of the element.  : string
getSubtotal() Returns the basket subtotal.  : float
getSubtotalPaymentSystem() Returns the basket payment system subtotal.  : float
getSubtotalRows() Returns the basket rows subtotal.  : float
getSubtotalShippings() Returns the basket shippings subtotal.  : float
getTotal() Returns the basket total.  : float
getTotalDiscounts() Returns the basket discounts total.  : float
getTotalPaymentSystem() Returns the basket payment system total.  : float
getTotalQuantity() Returns the total quantity of all rows on the basket.  : int
getTotalRows() Returns the basket rows total.  : float
getTotalShippings() Returns the basket shippings total.  : float
getTotalTaxes() Returns the basket taxes total.  : float
getTotalVouchers() Returns the basket vouchers total.  : float
jsonSerialize() Allow elements to be serialized.  : array<string|int, mixed>
toArray() Used to allow elements to be serialized.  : array<string|int, mixed>
getFieldItem()  : object|null
getFormattedData()  : mixed
setArrayField() Convert an API array of objects to a PHP array of objects.  : array<string|int, mixed>

Methods

__construct()

Elements constructor.

public __construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
$data : array<string|int, mixed> = []

Array that contains all the values to the object to initialize

Return values
mixed

__toString()

Uses "json_encode" function to return the JSON format of the element.

public __toString() : string

Auto-invoked using echo or concatenations.

Return values
string

getSubtotal()

Returns the basket subtotal.

public getSubtotal() : float
Return values
float

getSubtotalPaymentSystem()

Returns the basket payment system subtotal.

public getSubtotalPaymentSystem() : float
Return values
float

getSubtotalRows()

Returns the basket rows subtotal.

public getSubtotalRows() : float
Return values
float

getSubtotalShippings()

Returns the basket shippings subtotal.

public getSubtotalShippings() : float
Return values
float

getTotal()

Returns the basket total.

public getTotal() : float
Return values
float

getTotalDiscounts()

Returns the basket discounts total.

public getTotalDiscounts() : float
Return values
float

getTotalPaymentSystem()

Returns the basket payment system total.

public getTotalPaymentSystem() : float
Return values
float

getTotalQuantity()

Returns the total quantity of all rows on the basket.

public getTotalQuantity() : int
Return values
int

getTotalRows()

Returns the basket rows total.

public getTotalRows() : float
Return values
float

getTotalShippings()

Returns the basket shippings total.

public getTotalShippings() : float
Return values
float

getTotalTaxes()

Returns the basket taxes total.

public getTotalTaxes() : float
Return values
float

getTotalVouchers()

Returns the basket vouchers total.

public getTotalVouchers() : float
Return values
float

jsonSerialize()

Allow elements to be serialized.

public jsonSerialize() : array<string|int, mixed>

Auto-invoked using "json_encode" function.

Return values
array<string|int, mixed>

toArray()

Used to allow elements to be serialized.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldItem()

protected getFieldItem(array<string|int, mixed> $item, string $class) : object|null
Parameters
$item : array<string|int, mixed>
$class : string
Return values
object|null

getFormattedData()

protected getFormattedData(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

setArrayField()

Convert an API array of objects to a PHP array of objects.

protected setArrayField(array<string|int, mixed> $data, string $class) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

Array that contains all the values to the objects to initialize

$class : string

The PHP class we want the objects to be

Return values
array<string|int, mixed>

Search results