Exemplo n.º 1
0
function set_product_params($product_params)
{
    global $t, $currency, $settings;
    $params = "";
    foreach ($product_params as $param_name => $param_value) {
        if ($params) {
            $params .= "#";
        }
        $param_value = prepare_js_value($param_value);
        $params .= $param_name . "=" . $param_value;
    }
    $t->set_var("product_params", $params);
}
Exemplo n.º 2
0
            $t->parse("taxes", true);
        }
        // build param
        if ($taxes_param) {
            $taxes_param .= "&";
        }
        $taxes_param .= "tax_id=" . $tax_id;
        $taxes_param .= "&tax_type=" . prepare_js_value($tax_type);
        $taxes_param .= "&tax_name=" . prepare_js_value($tax_name);
        $taxes_param .= "&tax_free=" . prepare_js_value($current_tax_free);
        $taxes_param .= "&tax_percent=" . prepare_js_value($tax_percent);
        $taxes_param .= "&fixed_amount=" . prepare_js_value($fixed_amount);
        if (is_array($tax_types) && sizeof($tax_types) > 0) {
            foreach ($tax_types as $item_type_id => $item_type_info) {
                $taxes_param .= "&item_type_percent_" . $item_type_id . "=" . prepare_js_value($item_type_info["tax_percent"]);
                $taxes_param .= "&item_type_fixed_" . $item_type_id . "=" . prepare_js_value($item_type_info["fixed_amount"]);
            }
        }
    }
    $t->set_var("tax_rates", $taxes_param);
}
$order_total = round($goods_total, 2) - round($total_discount, 2) + round($properties_total, 2) + round($shipping_cost, 2);
if ($tax_prices_type != 1) {
    $order_total += round($taxes_total, 2);
}
// #13 - check if vouchers avaialable for this order
if (is_array($gift_vouchers) && sizeof($gift_vouchers) > 0) {
    foreach ($gift_vouchers as $voucher_id => $voucher_info) {
        $voucher_title = $voucher_info["title"];
        $voucher_max_amount = $voucher_info["max_amount"];
        if ($voucher_max_amount > $order_total) {