enhance add to basket
This commit is contained in:
@@ -8,9 +8,15 @@ use \Cart;
|
||||
|
||||
class ShopCart
|
||||
{
|
||||
public static function add($data)
|
||||
public static function add($item)
|
||||
{
|
||||
return self::get()->add($data);
|
||||
$ret = self::get()->add($item);
|
||||
return [
|
||||
'count' => self::count(),
|
||||
'quantity' => self::getTotalQuantity(),
|
||||
'total' => self::getTotal(),
|
||||
'added' => $item,
|
||||
];
|
||||
}
|
||||
|
||||
public static function remove($id)
|
||||
@@ -39,6 +45,16 @@ class ShopCart
|
||||
return self::getContent()->count();
|
||||
}
|
||||
|
||||
public static function getTotalQuantity()
|
||||
{
|
||||
return self::get()->getTotalQuantity();
|
||||
}
|
||||
|
||||
public static function getTotal()
|
||||
{
|
||||
return self::get()->getTotal();
|
||||
}
|
||||
|
||||
public static function getContent()
|
||||
{
|
||||
return self::get()->getContent();
|
||||
|
||||
Reference in New Issue
Block a user