= 2 && $count <= 4) { return $count . ' produkty'; } return $count . ' produktów'; } public static function summaryPrice($basket, $coupon = null) { global $lang_id; $summary = 0; if (is_array($basket)) { foreach ($basket as $position) { $product = \shop\Product::getFromCache((int)$position['product-id'], $lang_id); $product_price_tmp = \shop\Product::calculate_basket_product_price( (float)$product['price_brutto_promo'], (float)$product['price_brutto'], $coupon, $position ); $summary += $product_price_tmp['price_new'] * $position['quantity']; } } return \Shared\Helpers\Helpers::normalize_decimal($summary); } public static function countProducts($basket) { $count = 0; if (is_array($basket)) { foreach ($basket as $product) { $count += $product['quantity']; } } return $count; } }