public static function getCart() { $item = 0; $price = 0; if (Session::has('addcart')) { $cart = Session::get('addcart'); $item = 0; $price = 0; $mdPro = new Nproducts(); foreach (Session::get('addcart') as $key => $val) { $data = $mdPro->find($key); $price_convert = SiteHelpers::getPricePromotion($data); $price_item = $price_convert * $val; $price += $price_item; $item += $val; } } return $item . " item(s) - " . number_format($price, 0, ',', '.') . 'VNĐ'; }