CartItemOptionValue
class CartItemOptionValue implements Arrayable, Jsonable
Properties
int|string | $id | The ID of the cart item option value. |
|
string | $name | The name of the cart item option value. |
|
int|float | $qty | The quantity for this cart item option value. |
|
float | $price | The price of the cart item option value. |
Methods
CartItem constructor.
Returns the formatted price of this cart item option value
Returns the subtotal.
Set the quantity for this cart item.
Update the cart item option value from an array.
Create a new instance from the given array.
Get the instance as an array.
Convert the object to its JSON representation.
Details
at line 47
__construct(int|string $id, string $name, float $price)
CartItem constructor.
at line 69
string
price()
Returns the formatted price of this cart item option value
at line 80
string
subtotal()
Returns the subtotal.
Subtotal is price for whole CartItem with options
at line 90
setQuantity(int|float $qty)
Set the quantity for this cart item.
at line 105
void
updateFromArray(array $attributes)
Update the cart item option value from an array.
at line 120
static CartItemOptionValue
fromArray(array $attributes)
Create a new instance from the given array.
at line 138
array
toArray()
Get the instance as an array.
at line 155
string
toJson(int $options = 0)
Convert the object to its JSON representation.