mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-24 07:55:35 +00:00
Update CanBeBought.php
Use getAttribute method from HasAttributes trait,
This commit is contained in:
@@ -21,16 +21,16 @@ trait CanBeBought
|
|||||||
*/
|
*/
|
||||||
public function getBuyableDescription($options = null)
|
public function getBuyableDescription($options = null)
|
||||||
{
|
{
|
||||||
if (isset($this->name)) {
|
if (($name = $this->getAttribute('name'))) {
|
||||||
return $this->name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->title)) {
|
if (($title $this->getAttribute('title'))) {
|
||||||
return $this->title;
|
return $ttle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->description)) {
|
if (($description = $this->getAttribute('description')) {
|
||||||
return $this->description;
|
return $description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,8 +41,8 @@ trait CanBeBought
|
|||||||
*/
|
*/
|
||||||
public function getBuyablePrice($options = null)
|
public function getBuyablePrice($options = null)
|
||||||
{
|
{
|
||||||
if (isset($this->price)) {
|
if (($price = $this->getAttribute('price'))) {
|
||||||
return $this->price;
|
return $price;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,8 +53,8 @@ trait CanBeBought
|
|||||||
*/
|
*/
|
||||||
public function getBuyableWeight($options = null)
|
public function getBuyableWeight($options = null)
|
||||||
{
|
{
|
||||||
if (isset($this->weight)) {
|
if (($weight = $this->getAttribute('weight'))) {
|
||||||
return $this->weight;
|
return $weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user