mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 10:44:32 +00:00
add handling for arrays
This commit is contained in:
@@ -70,7 +70,7 @@ class CartItem implements Arrayable, Jsonable
|
||||
/**
|
||||
* The options for this cart item.
|
||||
*
|
||||
* @var CartItemOptions
|
||||
* @var CartItemOptions|array
|
||||
*/
|
||||
public $options;
|
||||
|
||||
@@ -480,7 +480,9 @@ class CartItem implements Arrayable, Jsonable
|
||||
'qty' => $this->qty,
|
||||
'price' => $this->price,
|
||||
'weight' => $this->weight,
|
||||
'options' => $this->options->toArray(),
|
||||
'options' => is_object($this->options)
|
||||
? $this->options->toArray()
|
||||
: $this->options,
|
||||
'discount' => $this->discount,
|
||||
'tax' => $this->tax,
|
||||
'subtotal' => $this->subtotal,
|
||||
|
||||
Reference in New Issue
Block a user