?>
<ul id="productDetailsList" class="floatingBox back">
  <?php 
    echo (($flag_show_product_info_model == 1 and $products_model != '') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n";
    ?>
  <?php 
    echo (($flag_show_product_info_weight == 1 and $products_weight != 0) ? '<li>' . TEXT_PRODUCT_WEIGHT . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' : '') . "\n";
    ?>
  <?php 
    echo ($flag_show_product_info_quantity == 1 ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n";
    ?>
  <?php 
    echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n";
    ?>
  <?php 
    echo (($advanced_stock = zen_addOnModules_call_function('advanced_stock', 'display_advanced_stock', array((int) $_GET['products_id']))) != '' ? '<li>' . $advanced_stock . '</li>' : '') . "\n";
    ?>
</ul>
<br class="clearBoth" />
<?php 
}
?>
<!--eof Product details list -->

<!--bof Attributes Module -->
<?php 
if ($pr_attr->fields['total'] > 0) {
    /**
     * display the product atributes
     */
    require $template->get_template_dir('/tpl_modules_attributes.php', DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/tpl_modules_attributes.php';
} else {
    ?>
            <?php 
    $display_qty = ($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<dt>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . '</dt><dd>' . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</dd>' : '';
    if ($products_qty_box_status == 0 or $products_quantity_order_max == 1) {
        // hide the quantity box and default to 1
        $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int) $_GET['products_id']);
    } else {
        // show the quantity box
        $the_button = '';
        $the_button .= '<dt>' . PRODUCTS_ORDER_QTY . '</dt>' . "\n";
        $the_button .= '<dd><input type="text" name="cart_quantity" value="' . zen_get_buy_now_qty($_GET['products_id']) . '" maxlength="6" size="4" />' . PRODUCTS_ORDER_QTY_TEXT . '<br />' . zen_get_products_quantity_min_units_display((int) $_GET['products_id']) . '' . zen_draw_hidden_field('products_id', (int) $_GET['products_id']) . '</dd>' . "\n" . '</dl>' . "\n";
    }
    $in_cart_button_html = '<div class="cartAdd">' . '<div class="price">' . ((zen_has_product_attributes_values((int) $_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int) $_GET['products_id']) . '</div>' . "\n" . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT, 'class="imgover"') . '</div>';
    $the_button .= $in_cart_button_html;
    $display_button = ($advanced_stock_button = zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_buy_now_button', array($_GET['products_id'], $the_button))) != '' ? $advanced_stock_button : zen_get_buy_now_button($_GET['products_id'], $the_button);
    ?>

<?php 
    if ($display_qty != '' or $display_button != '') {
        echo $display_qty;
        echo $display_button;
    }
    // display qty and button
}
// CUSTOMERS_APPROVAL == 3
?>
<!--eof Add to Cart Box-->

<ul id="productInformation">
<?php 
     $lc_button = '';
     if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
         $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     } else {
         if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
             if (zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N' && $listing->fields['product_is_call'] == 0 && ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0)) {
                 $how_many++;
             }
             $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>';
         }
     }
     $the_button = $lc_button;
     $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $lc_text .= '<br />' . (($advanced_stock_button = zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_buy_now_button', array($listing->fields['products_id'], $the_button, $products_link))) != '' ? $advanced_stock_button : zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link)) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
     $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
     break;
 case 'PRODUCT_LIST_QUANTITY':
     $lc_align = 'right';
     $lc_text = $listing->fields['products_quantity'];
     break;
 case 'PRODUCT_LIST_WEIGHT':
     $lc_align = 'right';
     $lc_text = $listing->fields['products_weight'];
     break;
 case 'PRODUCT_LIST_IMAGE':
     $lc_align = 'center';
     if (isset($_GET['manufacturers_id'])) {
         $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT) . '</a>';
     } else {
</div>

<?php 
        } else {
            ?>
<div class="messageStackError"><?php 
            echo OUT_OF_STOCK_CANT_CHECKOUT;
            ?>
</div>

<?php 
        }
        //endif STOCK_ALLOW_CHECKOUT
    }
    //endif flagAnyOutOfStock
    if (($advanced_stock_message = zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_sendfor_message')) != '' && isset($flagAnySendForProduct) && $flagAnySendForProduct) {
        ?>
<div class="messageStackError"><?php 
        echo $advanced_stock_message;
        ?>
</div>
<?php 
    }
    ?>
<table  border="0" width="100%" cellspacing="0" cellpadding="0" id="cartContentsDisplay">
     <tr class="tableHeading">
        <th scope="col" id="scQuantityHeading"><?php 
    echo TABLE_HEADING_QUANTITY;
    ?>
</th>
        <th scope="col" id="scUpdateQuantity">&nbsp;</th>
Ejemplo n.º 5
0
        $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_SHIPPING));
        zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
}
// Validate Cart for checkout
$_SESSION['valid_to_checkout'] = true;
$_SESSION['cart']->get_products(true);
if ($_SESSION['valid_to_checkout'] == false) {
    $messageStack->add('header', ERROR_CART_UPDATE, 'error');
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
// Stock Check
if (STOCK_CHECK == 'true' && STOCK_ALLOW_CHECKOUT != 'true') {
    $products = $_SESSION['cart']->get_products();
    for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
        if (zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_sendfor_status', array($products[$i]['id'])) != '') {
            continue;
        }
        if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
        }
    }
}
// if no shipping destination address was selected, use the customers own address as default
if (!$_SESSION['sendto']) {
    $_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
} else {
    // verify the selected shipping address
    $check_address_query = "SELECT count(*) AS total\r\n                            FROM   " . TABLE_ADDRESS_BOOK . "\r\n                            WHERE  customers_id = :customersID\r\n                            AND    address_book_id = :addressBookID";
    $check_address_query = $db->bindVars($check_address_query, ':customersID', $_SESSION['customer_id'], 'integer');
Ejemplo n.º 6
0
function pwas_notify_checkout_start_confirmation()
{
    global $messageStack;
    global $credit_covers;
    // if there is nothing in the customers cart, redirect them to the shopping cart page
    if ($_SESSION['cart']->count_contents() <= 0) {
        zen_redirect(zen_href_link(FILENAME_TIME_OUT));
    }
    // if the customer is not logged on, redirect them to the login page
    if (!$_SESSION['customer_id']) {
        $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
        zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    } else {
        // validate customer
        if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
            $_SESSION['navigation']->set_snapshot();
            zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
        }
    }
    // avoid hack attempts during the checkout procedure by checking the internal cartID
    if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) {
        if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
            zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
        }
    }
    // if no shipping method has been selected, redirect the customer to the shipping method selection page
    if (!$_SESSION['shipping']) {
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
    if (isset($_POST['payment'])) {
        $_SESSION['payment'] = $_POST['payment'];
    }
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
    //'checkout_payment_discounts'
    //zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
        if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') {
            $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error');
        }
    }
    //echo $messageStack->size('checkout_payment');
    require DIR_FS_CATALOG_ADDON_MODULES . 'products_with_attributes_stock/classes/order.php';
    $order = new pwas_order();
    // Stock Check
    $any_out_of_stock = false;
    if (STOCK_CHECK == 'true') {
        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
            if (zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_sendfor_status', array($products[$i]['id'])) != '') {
                continue;
            }
            $order->products[$i]['stock_check'] = '';
            // Added to allow individual stock of different attributes
            unset($attributes);
            if (is_array($order->products[$i]['attributes'])) {
                $attributes = $order->products[$i]['attributes'];
            } else {
                $attributes = '';
            }
            // End change
            $stock_check = pwas_check_stock($order->products[$i]['id'], $order->products[$i]['qty'], $attributes);
            if (zen_not_null($stock_check)) {
                $any_out_of_stock = true;
                $order->products[$i]['stock_check'] = $stock_check;
            }
        }
    }
    // Out of Stock
    if (STOCK_ALLOW_CHECKOUT != 'true' && $any_out_of_stock == true) {
        zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
    }
}