mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 07:31:31 +00:00
Manually merged https://github.com/Crinsane/LaravelShoppingcart/pull/502
Added more tests
This commit is contained in:
@@ -28,11 +28,12 @@ class BuyableProduct implements Buyable
|
||||
* @param string $name
|
||||
* @param float $price
|
||||
*/
|
||||
public function __construct($id = 1, $name = 'Item name', $price = 10.00)
|
||||
public function __construct($id = 1, $name = 'Item name', $price = 10.00, $weight = 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
$this->price = $price;
|
||||
$this->weight = $weight;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,4 +65,14 @@ class BuyableProduct implements Buyable
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the price of the Buyable item.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getBuyableWeight($options = null)
|
||||
{
|
||||
return $this->weight;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user