Fixed flex service.

This commit is contained in:
Edward Yang 2023-06-02 14:38:45 +08:00
parent fb8ac8dea4
commit a29245b5d4
1 changed files with 22 additions and 1 deletions

View File

@ -138,13 +138,34 @@ class TotalService
return collect($carts)->sum('subtotal');
}
public function getCartProducts()
/**
* Get Cart Products
*
* @return array
*/
public function getCartProducts(): array
{
return $this->cartProducts;
}
/**
* Get Current Cart
*
* @return Cart
*/
public function getCurrentCart()
{
return $this->currentCart;
}
/**
* Get Cart Product Amount
*
* @return mixed
*/
public function countProducts(): mixed
{
$cartProducts = $this->getCartProducts();
return collect($cartProducts)->sum('quantity');
}
}