interface OrderItemInterface implements AdjustableInterface, OrderAwareInterface

Interface OrderItemInterface

Constants

STATE_COMPLETE

Order item states

STATE_PARTIAL

STATE_UNCOMPLETE

PRODUCT_QUANTITY_REBATE

PRODUCT_PRICE_LIST_DISCOUNT

PRODUCT_GROUP_DISCOUNT

PRODUCT_GROUP_FIXED_DISCOUNT

PRODUCT_PRICE_LIST_AND_GROUP_DISCOUNT

CHECKOUT_ADDED_PRODUCT_ATTRIBUTE_VALUES_ID

Methods

Collection|AdjustmentInterface[]
getAdjustments(null|string $type = null)

Return all adjustments attached to adjustable subject.

addAdjustment(AdjustmentInterface $adjustment)

Add adjustment.

removeAdjustment(AdjustmentInterface $adjustment)

Remove adjustment.

integer
getAdjustmentsTotal(null|string $type = null)

Get adjustments total.

removeAdjustments(string $type)

Remove adjustment.

clearAdjustments()

Clears all adjustments.

calculateAdjustmentsTotal()

Calculate adjustments total.

getOrder()

Return the order.

setOrder(OrderInterface $order = null)

Set the order.

int
getQuantity()

Get item quantity.

setQuantity(int $quantity)

Set quantity.

getProduct()

Get item product.

setProduct(Product $product)

Set product.

int
getUnitPrice()

Get unit price of item.

setUnitPrice(int $unitPrice)

Define the unit price of item.

int
getTotal()

Get item total.

setTotal(int $total)

Set item total.

calculateTotal()

Calculate total based on quantity and unit price.

Collection
getProductAttValues()

Get selected attribute values for product in order item

bool
equals(OrderItemInterface $orderItem)

Checks whether the item given as argument corresponds to the same cart item. Can be overwritten to enable merge quantities.

merge(OrderItemInterface $orderItem, bool $throwOnInvalid = true, float $qty)

Merge the item given as argument corresponding to the same cart item.

Details

in AdjustableInterface at line 27
Collection|AdjustmentInterface[] getAdjustments(null|string $type = null)

Return all adjustments attached to adjustable subject.

Parameters

null|string $type

Return Value

Collection|AdjustmentInterface[]

in AdjustableInterface at line 34
addAdjustment(AdjustmentInterface $adjustment)

Add adjustment.

Parameters

AdjustmentInterface $adjustment

in AdjustableInterface at line 41
removeAdjustment(AdjustmentInterface $adjustment)

Remove adjustment.

Parameters

AdjustmentInterface $adjustment

in AdjustableInterface at line 50
integer getAdjustmentsTotal(null|string $type = null)

Get adjustments total.

Parameters

null|string $type

Return Value

integer

in AdjustableInterface at line 57
removeAdjustments(string $type)

Remove adjustment.

Parameters

string $type

in AdjustableInterface at line 62
clearAdjustments()

Clears all adjustments.

in AdjustableInterface at line 67
calculateAdjustmentsTotal()

Calculate adjustments total.

in OrderAwareInterface at line 23
OrderInterface getOrder()

Return the order.

Return Value

OrderInterface

in OrderAwareInterface at line 30
setOrder(OrderInterface $order = null)

Set the order.

Parameters

OrderInterface $order

at line 40
int getQuantity()

Get item quantity.

Return Value

int

at line 47
setQuantity(int $quantity)

Set quantity.

Parameters

int $quantity

at line 55
Product getProduct()

Get item product.

Return Value

Product

at line 62
setProduct(Product $product)

Set product.

Parameters

Product $product

at line 69
int getUnitPrice()

Get unit price of item.

Return Value

int

at line 76
setUnitPrice(int $unitPrice)

Define the unit price of item.

Parameters

int $unitPrice

at line 83
int getTotal()

Get item total.

Return Value

int

at line 90
setTotal(int $total)

Set item total.

Parameters

int $total

at line 96
calculateTotal()

Calculate total based on quantity and unit price.

Take adjustments into account.

at line 103
Collection getProductAttValues()

Get selected attribute values for product in order item

Return Value

Collection

at line 114
bool equals(OrderItemInterface $orderItem)

Checks whether the item given as argument corresponds to the same cart item. Can be overwritten to enable merge quantities.

Parameters

OrderItemInterface $orderItem

Return Value

bool

at line 124
merge(OrderItemInterface $orderItem, bool $throwOnInvalid = true, float $qty)

Merge the item given as argument corresponding to the same cart item.

Parameters

OrderItemInterface $orderItem
bool $throwOnInvalid
float $qty