add options to buyable methods

This commit is contained in:
Mikhail Lisnyak
2016-09-04 12:11:03 +03:00
parent c827ff25c3
commit e801689441
3 changed files with 10 additions and 10 deletions

View File

@@ -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);
}
/**