CartItemOption
class CartItemOption implements Arrayable, Jsonable
Properties
int|string | $id | The ID of the cart item option. |
|
string | $name | The name of the cart item option. |
|
Collection | $values | The values for this cart item option. |
Methods
__construct(int|string $id, string $name, array $values = [])
CartItem constructor.
string
subtotal()
Returns the subtotal.
void
updateFromArray(array $attributes)
Update the cart item from an array.
static CartItemOption
fromArray(array $attributes)
Create a new instance from the given array.
makeCartOptionValues($values)
No description
array
toArray()
Get the instance as an array.
string
toJson(int $options = 0)
Convert the object to its JSON representation.
Details
at line 38
__construct(int|string $id, string $name, array $values = [])
CartItem constructor.
at line 58
string
subtotal()
Returns the subtotal.
Subtotal is price for whole CartItem with options
at line 72
void
updateFromArray(array $attributes)
Update the cart item from an array.
at line 86
static CartItemOption
fromArray(array $attributes)
Create a new instance from the given array.
at line 95
protected
makeCartOptionValues($values)
No description
at line 110
array
toArray()
Get the instance as an array.
at line 126
string
toJson(int $options = 0)
Convert the object to its JSON representation.