Beispiel #1
0
/**
 * getting additional (banner/order/roll up) order total price
 * @param array & $additional_orders
 * @param int $type ( 1(banner) / 2(poster) /3(roll up) )
 * @return int $total_price
 */
function get_additional_order_total_price(&$additional_orders, $type)
{
    $add_prices = get_additional_prices();
    $total_price = 0;
    foreach ($additional_orders as $item) {
        $total_price += $item['amount'] * get_price_by_square($item['width'], $item['height'], $add_prices[$type]);
    }
    return round($total_price);
}
Beispiel #2
0
    header('location: /');
    exit;
}
import('checkout');
import('store');
$materials = get_materials();
$campaign_orders = get_campaign_orders($order_id);
$order_weeks = get_order_weeks($order_id);
$banner_orders = get_additional_orders_by_type($order_id, 1);
$poster_orders = get_additional_orders_by_type($order_id, 2);
$rollup_orders = get_additional_orders_by_type($order_id, 3);
$campaign_stores = get_campaign_stores($order_id);
$campaign_totals = get_campaign_items_total($order_id);
$campaign_orders_list = get_campaign_orders_list($order_id);
$prices = get_campaign_prices();
$add_prices = get_additional_prices();
$template_name = '';
if ($campaign_orders && !$banner_orders && !$poster_orders && !$rollup_orders) {
    $template_name = 'campaign_checkout';
} elseif (!$campaign_orders && $banner_orders && !$poster_orders && !$rollup_orders) {
    $template_name = 'banners_checkout';
} elseif (!$campaign_orders && !$banner_orders && $poster_orders && !$rollup_orders) {
    $template_name = 'posters_checkout';
} elseif (!$campaign_orders && !$banner_orders && !$poster_orders && $rollup_orders) {
    $template_name = 'rollups_checkout';
} elseif ($campaign_orders || $banner_orders || $poster_orders || $rollup_orders) {
    $template_name = 'full_checkout';
}
if (!$template_name) {
    header('location: /');
    exit;