예제 #1
0
// if no shipping method has been selected, redirect the customer to the shipping method selection page
if (!isset($_SESSION['shipping'])) {
    MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_shipping'], '', 'SSL'));
}
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) {
    if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
        MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_shipping'], '', 'SSL'));
    }
}
// Stock Check
if (STOCK_CHECK == '1' && STOCK_ALLOW_CHECKOUT != '1') {
    $products = $_SESSION['cart']->get_products();
    $any_out_of_stock = 0;
    for ($i = 0, $n = count($products); $i < $n; $i++) {
        if (oos_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
            $any_out_of_stock = 1;
        }
    }
    if ($any_out_of_stock == 1) {
        MyOOS_CoreApi::redirect(oos_href_link($aPages['shopping_cart']));
    }
}
// if no billing destination address was selected, use the customers own address as default
if (!isset($_SESSION['billto'])) {
    $_SESSION['billto'] = $_SESSION['customer_default_address_id'];
} else {
    // verify the selected billing address
    $address_booktable = $oostable['address_book'];
    $sql = "SELECT COUNT(*) AS total\n            FROM {$address_booktable}\n            WHERE customers_id = '" . intval($_SESSION['customer_id']) . "'\n              AND address_book_id = '" . intval($_SESSION['billto']) . "'";
    $check_address_result = $dbconn->Execute($sql);
    }

    if (is_array($oPaymentModules->modules)) {
      $oPaymentModules->pre_confirmation_check();
    }

    // load the selected shipping module
    require 'includes/classes/class_shipping.php';
    $shipping_modules = new shipping($_SESSION['shipping']);


    // Stock Check
    $any_out_of_stock = false;
    if (STOCK_CHECK == '1') {
        for ($i=0, $n=count($oOrder->products); $i<$n; $i++) {
            if (oos_check_stock($oOrder->products[$i]['id'], $oOrder->products[$i]['qty'])) {
                $any_out_of_stock = true;
            }
        }
        // Out of Stock
        if ( (STOCK_ALLOW_CHECKOUT != '1') && ($any_out_of_stock == true) ) {
            MyOOS_CoreApi::redirect(oos_href_link($aPages['shopping_cart']));
        }
    }

    // links breadcrumb
    $oBreadcrumb->add(decode($aLang['navbar_title_1']), oos_href_link($aPages['checkout_shipping'], '', 'SSL'));
    $oBreadcrumb->add(decode($aLang['navbar_title_2']));

    $aOption['template_main'] = $sTheme . '/modules/checkout_confirmation.html';
    $aOption['page_heading'] = $sTheme . '/heading/page_heading.html';
예제 #3
0
     $shopping_cart_detail .= '    <td align="center" valign="top" class ="main">' . $quantity . '</td>' . "\n";
 }
 if (PRODUCT_LIST_MODEL > 0) {
     if ($sPage == $aPages['shopping_cart']) {
         $shopping_cart_detail .= '    <td valign="top" class="main"><a href="' . oos_href_link($aPages['product_info'], 'products_id=' . $products[$i]['id']) . '">' . $products[$i]['model'] . '</a></td>' . "\n";
     }
 }
 // Product name, with or without link
 if ($sPage == $aPages['shopping_cart']) {
     $shopping_cart_detail .= '    <td valign="top" class="main"><a href="' . oos_href_link($aPages['product_info'], 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
 } else {
     $shopping_cart_detail .= '    <td valign="top" class="main"><b>' . $products[$i]['name'] . '</b>';
 }
 // Display marker if stock quantity insufficient
 if (STOCK_CHECK == '1') {
     $shopping_cart_detail .= $stock_check = oos_check_stock($products[$i]['id'], $products[$i]['quantity']);
     if ($stock_check) {
         $any_out_of_stock = 1;
     }
 }
 // Wishlist names
 if (!empty($products[$i]['towlid'])) {
     $shopping_cart_detail .= '<br /><a href="' . oos_href_link($aPages['main_wishlist'], 'wlid=' . $products[$i]['towlid'], 'NONSSL') . '">' . oos_image(OOS_IMAGES . 'wl.gif', oos_get_wishlist_name($products[$i]['towlid'])) . '</a>' . "\n";
     $shopping_cart_detail .= '<small><i><a href="' . oos_href_link($aPages['main_wishlist'], 'wlid=' . $products[$i]['towlid'], 'NONSSL') . '">' . oos_get_wishlist_name($products[$i]['towlid']) . '</a></i></small>';
     $shopping_cart_detail .= oos_draw_hidden_field('to_wl_id[]', $products[$i]['towlid']);
 }
 // Product options names
 if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
     foreach ($products[$i]['attributes'] as $option => $value) {
         $shopping_cart_detail .= '<br /><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
     }