class BasePrice extends Price

Properties

protected array $config The unit configurations. from Price
protected string $unit The products unit. from Price
protected int $volume The products volume. from Price
protected string $volumeUnit The products volume unit. from Price
protected int $price The products price. from Price
protected string $priceUnit The products price unit. from Price
protected Product $product The product. from Price

Methods

__construct(Product $product)

Create a new price instance.

from Price
int
amount()

Get the price amount.

string
unit()

Get the price unit.

int
total()

Add commission to the amount.

from Price
string
baseUnit(string $unit)

Fetch the base for the given unit.

from Price
int
factor(string $unit)

Fetch the factor for the given unit.

from Price
mixed
config(string $unit, string $key)

Get the units config and store it on the object.

from Price
int
canonicalizedVolume()

Get the canonicalized volume.

bool
isPiece()

Check if the products is an quantity article.

Details

in Price at line 65
__construct(Product $product)

Create a new price instance.

Parameters

Product $product

at line 12
int amount()

Get the price amount.

Return Value

int

at line 26
string unit()

Get the price unit.

Return Value

string

in Price at line 94
int total()

Add commission to the amount.

Return Value

int

in Price at line 107
protected string baseUnit(string $unit)

Fetch the base for the given unit.

Parameters

string $unit

Return Value

string

in Price at line 118
protected int factor(string $unit)

Fetch the factor for the given unit.

Parameters

string $unit

Return Value

int

in Price at line 128
protected mixed config(string $unit, string $key)

Get the units config and store it on the object.

Parameters

string $unit
string $key

Return Value

mixed

at line 40
protected int canonicalizedVolume()

Get the canonicalized volume.

Return Value

int

at line 50
protected bool isPiece()

Check if the products is an quantity article.

Return Value

bool