Merge pull request #141 from macbookandrew/bugfix/cart-item-to-array

fix CartItem options
This commit is contained in:
Patrick
2021-12-12 15:21:19 +01:00
committed by GitHub

View File

@@ -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,