static function get_cart_item_total($item_id, $item) { /* @since 1.1.3 */ $count_sale = 0; $price_sale = $item['price']; if (!empty($item['data']['discount'])) { $count_sale = $item['data']['discount']; $price_sale = $item['data']['price_sale'] * $item['number']; } $type_price = $item['data']['type_price']; if ($type_price == 'people_price') { $adult_num = $item['data']['adult_number']; $child_num = $item['data']['child_number']; $adult_price = $item['data']['adult_price']; $child_price = $item['data']['child_price']; if ($get_array_discount_by_person_num = self::get_array_discount_by_person_num($item_id)) { if ($array_adult = $get_array_discount_by_person_num['adult']) { if (is_array($array_adult) and !empty($array_adult)) { foreach ($array_adult as $key => $value) { if ($adult_num >= (int) $key) { $adult_price2 = $adult_price * $value; } } $adult_price -= $adult_price2; } } if ($array_child = $get_array_discount_by_person_num['child']) { if (is_array($array_child) and !empty($array_child)) { foreach ($array_child as $key => $value) { if ($child_num >= (int) $key) { $child_price2 = $child_price * $value; } } $child_price -= $child_price2; } } } $adult_price = round($adult_price); $child_price = round($child_price); $total_price = $adult_num * st_get_discount_value($adult_price, $count_sale, false); $total_price += $child_num * st_get_discount_value($child_price, $count_sale, false); return $total_price; } else { $price = $price_sale * $item['number']; return $price; } }
_e('Adult Price', ST_TEXTDOMAIN); ?> </p> <p class="booking-item-payment-price-amount"><?php echo $adult_num . ' x ' . st_get_discount_value($adult_price, $count_sale); ?> </small> </p> </li> <li> <p class="booking-item-payment-price-title"><?php _e('Children Price', ST_TEXTDOMAIN); ?> </p> <p class="booking-item-payment-price-amount"><?php echo $child_num . ' x ' . st_get_discount_value($child_price, $count_sale); ?> </small> </p> </li> <?php } else { ?> <li> <?php if (!empty($item['data']['discount'])) { ?> <p class="booking-item-payment-price-title"><?php st_the_language('guests'); st_the_language('price'); ?>