Example #1
0
<?php 
$order = new Order();
$order_info = $order->GetOrder($_SESSION['orderid']);
$payment_method = $order_info->payment_method;
$ship_method = $order_info->shipping_method;
$ship_amount = $order_info->shipping_cost;
$ooder_total = $order->CalcOrderTotal($_SESSION['orderid']);
?>

<?php 
$settings = maybe_unserialize(get_option('_wpmp_settings'));
$currency_sign = get_option('_wpmp_curr_sign', '$');
//print_r($currency_sign); echo "hello world";
//calculate shipping
if ($settings['calc_shipping'] == 1) {
    $ship = wpmp_calculate_shipping();
    $shipping_row = '<tr><td colspan=5 align=right>' . __('Shipping', 'wpmarketplace') . ' (' . $ship['method'] . '):</td><td class="amt" id="s_cost">' . $currency_sign . number_format($ship['cost'], 2, ".", "") . '</td></tr>';
} else {
    $shipping_row = "";
}
//calculate tax
$tax_summery = $order->wpmp_calculate_tax();
if (count($tax_summery) > 0) {
    foreach ($tax_summery as $taxrow) {
        $tax_row .= "<tr><td colspan=5 align=right>" . $taxrow['label'] . ":</td><td class='amt' >" . $currency_sign . number_format($taxrow['rates'], 2, ".", "") . "</td></tr>";
    }
} else {
    $tax_row = "";
}
$grand_total = '<tr><td colspan=5 align=right>' . __('Grand Total:', 'wpmarketplace') . '</td><td id="g_total" class="amt">' . $currency_sign . number_format($ooder_total, 2, ".", "") . '</td></tr>';
global $wpdb;
Example #2
0
function wpmp_save_shipping_info()
{
    if (isset($_REQUEST['checkout_shipping']) && $_REQUEST['checkout_shipping'] == "save") {
        global $current_user;
        get_currentuserinfo();
        $data = array('shipping_method' => $_POST['shipping_method'], 'shipping_cost' => $_POST['shipping_rate']);
        $order = new Order();
        $od = $order->Update($data, $_SESSION['orderid']);
        $order_total = $order->CalcOrderTotal($_SESSION['orderid']);
        $shipping = wpmp_calculate_shipping();
        $order_total = $order_total + $shipping['cost'];
        if ($order_total > 0) {
            include_once "tpls/payment_method.php";
        } else {
            $order_info = $order->GetOrder($_SESSION['orderid']);
            include_once "tpls/order_review.php";
        }
        die;
    }
}