Skip to content
Last updated

WHMCS\Cart\Item\ItemInterface

Interface

Methods

getUuid

public function getUuid(): string

Runtime unique id for cart item

Returns string

setId

public function setId(?string $id): self

Set type prefixed product identifier

Parameters

TypeNameDescription
string|null$id

Returns self

getId

public function getId(): ?string

Get prefixed product identifier

Returns string\|null

setName

public function setName(string $name): self

Set description name

Parameters

TypeNameDescription
string$name

Returns self

getName

public function getName(): string

Get description name

Returns string

setBillingCycle

public function setBillingCycle($billingCycle): self

Set billing cycle, such as free, onetime, monthly, quarterly, etc

Returns self

getBillingCycle

public function getBillingCycle(): string

Get billing cycle

Returns string

setBillingPeriod

public function setBillingPeriod(string $billingPeriod): self

Start date for items that renew

Parameters

TypeNameDescription
string$billingPeriod

Returns self

getBillingPeriod

public function getBillingPeriod(): int

Get start date for items that renew

Returns int

setQuantity

public function setQuantity(int $qty): self

Set quantity for scaling quantity items

Parameters

TypeNameDescription
int$qty

Returns self

getQuantity

public function getQuantity(): int

Get quantity for scaling quantity items

Returns int

setAmount

public function setAmount(Price $amount): self

Set initial cost amount

Parameters

TypeNameDescription
Price$amount

Returns self

getAmount

public function getAmount(): Price

Get Initial cost amount

Returns Price

setRecurringAmount

public function setRecurringAmount(Price $recurring = null): self

Set recurring cost amount

Parameters

TypeNameDescription
Price|null$recurring

Returns self

getRecurringAmount

public function getRecurringAmount(): ?Price

Get recurring cost amount

Returns Price\|null

setTaxed

public function setTaxed(bool $taxed): self

Set taxable status of item

Parameters

TypeNameDescription
bool$taxed

Returns self

isTaxed

public function isTaxed(): bool

Is item taxable

Returns bool

setInitialPeriod

public function setInitialPeriod(string $period, string $cycle): self

Set initial period in days for prorated item

Parameters

TypeNameDescription
string$period
string$cycle

Returns self

hasInitialPeriod

public function hasInitialPeriod(): bool

If an initial period is defined (prorata)

Returns bool

isRecurring

public function isRecurring(): bool

If the item is a of a recurring cycle

Returns bool

getType

public function getType(): string

Item type such as Product, Addon, Domain or generic Item

Returns string

getSetupAmount

public function getSetupAmount(): Price

The setup amount

Returns Price

setSetupAmount

public function setSetupAmount(?Price $amount)

Set the setup amount

Parameters

TypeNameDescription
Price|null$amount

getRecurringBasePrice

public function getRecurringBasePrice(): Price

The recurring base price without Tax or Setup fee

Returns Price

setRecurringBasePrice

public function setRecurringBasePrice(?Price $amount)

Set the base prince

Parameters

TypeNameDescription
Price|null$amount

getItemName

public function getItemName(): string

Item's name without concatenated group's name

Returns string

setItemName

public function setItemName(string $name)

getItemGroupName

public function getItemGroupName(): string

Item's group name (without its name)

Returns string

setItemGroupName

public function setItemGroupName(string $groupName)

getItemGroupId

public function getItemGroupId(): int

setItemGroupId

public function setItemGroupId(int $groupId)

getAmountExcludeTaxSetup

public function getAmountExcludeTaxSetup(): Price

Initial cost without Tax and Setup fee

Returns Price

setAmountExcludeTaxSetup

public function setAmountExcludeTaxSetup(?Price $price)

isFree

public function isFree(): bool

If the cart item has free billing cycle

Returns bool