= 5 ): $count_products .= ' produktów'; break; } return $count_products; } public static function summary_price( $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 \S::normalize_decimal( $summary ); } public static function count_products( $basket ) { $count = 0; if ( is_array( $basket ) ) foreach ( $basket as $product ) $count += $product[ 'quantity' ]; return $count; } }