mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-22 07:05:23 +00:00
add options to buyable methods
This commit is contained in:
@@ -192,9 +192,9 @@ class CartItem implements Arrayable
|
||||
*/
|
||||
public function updateFromBuyable(Buyable $item)
|
||||
{
|
||||
$this->id = $item->getBuyableIdentifier();
|
||||
$this->name = $item->getBuyableDescription();
|
||||
$this->price = $item->getBuyablePrice();
|
||||
$this->id = $item->getBuyableIdentifier($this->options);
|
||||
$this->name = $item->getBuyableDescription($this->options);
|
||||
$this->price = $item->getBuyablePrice($this->options);
|
||||
$this->priceTax = $this->price + $this->tax;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ class CartItem implements Arrayable
|
||||
*/
|
||||
public static function fromBuyable(Buyable $item, array $options = [])
|
||||
{
|
||||
return new self($item->getBuyableIdentifier(), $item->getBuyableDescription(), $item->getBuyablePrice(), $options);
|
||||
return new self($item->getBuyableIdentifier($options), $item->getBuyableDescription($options), $item->getBuyablePrice($options), $options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user