Method |
Description |
|
__construct ( $id, $name, integer $qty, string $price, array $options = [], boolean $taxable = true, boolean | false $lineItem = false ) |
CartItem constructor. |
|
addSubItem ( array $subItem, boolean $autoUpdate = true ) : CartSubItem |
Adds an sub item to a item. |
|
find ( $data ) : mixed |
Search for matching options on the item. |
|
findSubItem ( $subItemHash ) : mixed |
Finds a sub item by its hash. |
|
generateHash ( boolean $force = false ) : string |
Generates a hash based on the cartItem array. |
|
getDiscount ( boolean $format = true ) : string |
Gets the discount of an item. |
|
getHash ( ) : mixed |
Gets the hash for the item. |
|
getModel ( ) |
Returns a Model. |
|
price ( boolean $format = true, boolean $taxedItemsOnly = false ) : string |
Gets the price of the item with or without tax, with the proper format. |
|
removeSubItem ( $subItemHash ) |
Removes a sub item from the item. |
|
searchForSubItem ( $data ) : array |
A way to find sub items. |
|
setModel ( $itemModel, array $relations = [] ) |
Sets the related model to the item. |
|
subItemsTotal ( boolean $format = true, boolean $taxedItemsOnly = false ) : string |
Gets the totals for the options. |
|
subTotal ( boolean $format = true, boolean $withDiscount = true, boolean $taxedItemsOnly = false ) : string |
Gets the sub total of the item based on the qty with or without tax in the proper format. |
|
tax ( integer $amountNotTaxable ) : integer | mixed |
Gets the tax for the item. |
|