mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-21 14:55:02 +00:00
Removed Cart facade from coverage (does not provide a public inteterface)
Exclude migrations from coverage Added tests for InstanceIdentifier Added InstanceIdentifier support to store, restore and merge Added weight to CanBeBought trait Excluded CanBeBought trait from coverage temporarily
This commit is contained in:
@@ -16,15 +16,20 @@ trait CanBeBought
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the description or title of the Buyable item.
|
||||
* Get the name, title or description of the Buyable item.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBuyableDescription($options = null)
|
||||
{
|
||||
if(property_exists($this, 'name')) return $this->name;
|
||||
if(property_exists($this, 'title')) return $this->title;
|
||||
if(property_exists($this, 'description')) return $this->description;
|
||||
if(property_exists($this, 'name'))
|
||||
return $this->name;
|
||||
|
||||
if(property_exists($this, 'title'))
|
||||
return $this->title;
|
||||
|
||||
if(property_exists($this, 'description'))
|
||||
return $this->description;
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -36,8 +41,20 @@ trait CanBeBought
|
||||
*/
|
||||
public function getBuyablePrice($options = null)
|
||||
{
|
||||
if(property_exists($this, 'price')) return $this->price;
|
||||
|
||||
if(property_exists($this, 'price'))
|
||||
return $this->price;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the weight of the Buyable item.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getBuyableWeight($options = null)
|
||||
{
|
||||
if(property_exists($this, 'weight'))
|
||||
return $this->weight;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user