mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +00:00
Merge pull request #141 from macbookandrew/bugfix/cart-item-to-array
fix CartItem options
This commit is contained in:
@@ -70,7 +70,7 @@ class CartItem implements Arrayable, Jsonable
|
|||||||
/**
|
/**
|
||||||
* The options for this cart item.
|
* The options for this cart item.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var CartItemOptions|array
|
||||||
*/
|
*/
|
||||||
public $options;
|
public $options;
|
||||||
|
|
||||||
@@ -480,7 +480,9 @@ class CartItem implements Arrayable, Jsonable
|
|||||||
'qty' => $this->qty,
|
'qty' => $this->qty,
|
||||||
'price' => $this->price,
|
'price' => $this->price,
|
||||||
'weight' => $this->weight,
|
'weight' => $this->weight,
|
||||||
'options' => $this->options->toArray(),
|
'options' => is_object($this->options)
|
||||||
|
? $this->options->toArray()
|
||||||
|
: $this->options,
|
||||||
'discount' => $this->discount,
|
'discount' => $this->discount,
|
||||||
'tax' => $this->tax,
|
'tax' => $this->tax,
|
||||||
'subtotal' => $this->subtotal,
|
'subtotal' => $this->subtotal,
|
||||||
|
|||||||
Reference in New Issue
Block a user