<?php
/**
* Page Template
*
* Loaded automatically by index.php?main_page=shopping_cart.<br />
* Displays shopping-cart contents
*
* @package templateSystem
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_shopping_cart_default.php 15881 2010-04-11 16:32:39Z wilt $
*/
?>
<div class="centerColumn" id="shoppingCartDefault">
<?php
if ($flagHasCartContents) {
?>
<?php
if ($_SESSION['cart']->count_contents() > 0) {
?>
<div class="forward"><?php echo TEXT_VISITORS_CART; ?></div>
<?php
}
?>
<?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>
<?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product', $request_type)); ?>
<div id="cartInstructionsDisplay" class="content"><?php //echo TEXT_INFORMATION; ?></div>
<div id="shiphead2"> </div>
<?php if (!empty($totalsDisplay)) { ?>
<div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
<br class="clearBoth" />
<?php } ?>
<?php if ($flagAnyOutOfStock) { ?>
<?php if (STOCK_ALLOW_CHECKOUT == 'true') { ?>
<div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>
<?php } else { ?>
<div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>
<?php } //endif STOCK_ALLOW_CHECKOUT ?>
<?php } //endif flagAnyOutOfStock ?>
<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"> </th>
<th scope="col" id="scProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
<th scope="col" id="scUnitHeading"><?php echo TABLE_HEADING_PRICE; ?></th>
<th scope="col" id="scTotalHeading"><?php echo TABLE_HEADING_TOTAL; ?></th>
<th scope="col" id="scRemoveHeading"> </th>
</tr>
<!-- Loop through all products /-->
<?php
foreach ($productArray as $product) {
?>
<tr class="<?php echo $product['rowClass']; ?>">
<td class="cartQuantity">
<?php
if ($product['flagShowFixedQuantity']) {
echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
} else {
echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
}
?>
</td>
<td class="cartQuantityUpdate">
<?php
if ($product['buttonUpdate'] == '') {
echo '' ;
} else {
echo $product['buttonUpdate'];
}
?>
</td>
<td class="cartProductDisplay">
<div id="cartImage">
<a href="<?php echo $product['linkProductsName']; ?>">
<?php echo $product['productsImage']; ?>
</a>
</div>
<div id="cartProdTitle">
<a href="<?php echo $product['linkProductsName']; ?>">
<?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?>
</a>
</div>
<br class="clearBoth" />
<?php
echo $product['attributeHiddenField'];
if (isset($product['attributes']) && is_array($product['attributes'])) {
echo '<div class="cartAttribsList">';
echo '<ul>';
reset($product['attributes']);
foreach ($product['attributes'] as $option => $value) {
?>
<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>
<?php
}
echo '</ul>';
echo '</div>';
}
?>
</td>
<font color="#000000"><td class="cartUnitDisplay price"><?php echo $product['productsPriceEach']; ?></td></font>
<td class="cartTotalDisplay"><?php echo $product['productsPrice']; ?></td>
<td class="cartRemoveItemDisplay">
<?php
if ($product['buttonDelete']) {
?>
<a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&product_id=' . $product['id']); ?>"><?php echo zen_image($template->get_template_dir(ICON_IMAGE_TRASH, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_TRASH, ICON_TRASH_ALT); ?></a>
<?php
}
if ($product['checkBoxDelete'] ) {
echo zen_draw_checkbox_field('cart_delete[]', $product['id']);
}
?>
</td>
</tr>
<?php
} // end foreach ($productArray as $product)
?>
<!-- Finished loop through all products /-->
</table>
<div id="cartSubTotal">
<?php echo SUB_TITLE_SUB_TOTAL; ?> <span class="price"><?php echo $cartShowTotal; ?></span></div>
<br class="clearBoth" />
<div id="shipmain">
<!--bof shopping cart buttons-->
<?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT) . '</a>'; ?>
<?php if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {?>
<?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_SHIPPING_ESTIMATOR) . '\')">' .
zen_image_button(BUTTON_IMAGE_SHIPPING_ESTIMATOR, BUTTON_SHIPPING_ESTIMATOR_ALT) . '</a>'; ?>
<?php }
$str_r = (int)str_replace("U$","",str_replace("euro;","",str_replace("pound;","",str_replace(",","",substr($cartShowTotal,1)))));
?>
<input type="hidden" name="str_r" id="str_r_hid" value="<?php echo $str_r;?>" />
<?php echo '<a name="add_to_cart_wf" href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?>
<!--eof shopping cart buttons-->
</div>
</div>
<!--bof shopping cart buttons-->
<?php
// show update cart button
if (SHOW_SHOPPING_CART_UPDATE == 2 or SHOW_SHOPPING_CART_UPDATE == 3) {
?>
<?php
} else { // don't show update button below cart
?>
<?php
} // show update button
?>
<!--eof shopping cart buttons-->
</form>
<br class="clearBoth" />
<!-- ** BEGIN PAYPAL EXPRESS CHECKOUT ** -->
<?php // the tpl_ec_button template only displays EC option if cart contents >0 and value >0
if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True' && 1==3) {
include(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/tpl_ec_button.php');
}
?>
<!-- ** END PAYPAL EXPRESS CHECKOUT ** -->
<?php
if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '2') {
/**
* load the shipping estimator code if needed
*/
?>
<?php require(DIR_WS_MODULES . zen_get_module_directory('shipping_estimator.php')); ?>
<?php
}
?>
<?php
} else {
?>
<h2 id="cartEmptyText"><div class="shoping_carts"><img src="includes/templates/mazentop/images/Shopping Cart.jpg"></div></h2>
<?php require($template->get_template_dir('tpl_product_info_similar.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_product_info_similar2.php');?>
<?php
}
?>
</div>