enhance add to basket

This commit is contained in:
Ludovic CANDELLIER
2022-04-01 00:11:15 +02:00
parent e3c60e7cde
commit 8afb3467f8
17 changed files with 359 additions and 53 deletions

View File

@@ -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();