PageRenderTime 50ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/includes/templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php

http://google-checkout-zencart.googlecode.com/
PHP | 239 lines | 183 code | 28 blank | 28 comment | 38 complexity | 8ef1d6d05c78c88552c528c5d0aed02f MD5 | raw file
  1. <?php
  2. /**
  3. * Page Template
  4. *
  5. * Loaded automatically by index.php?main_page=shopping_cart.<br />
  6. * Displays shopping-cart contents
  7. *
  8. * @package templateSystem
  9. * @copyright Copyright 2003-2007 Zen Cart Development Team
  10. * @copyright Portions Copyright 2003 osCommerce
  11. * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  12. * @version $Id: tpl_shopping_cart_default.php 5554 2007-01-07 02:45:29Z drbyte $
  13. * @version $Id: tpl_shopping_cart_default.php 5936 2007-12-14 18:15:39Z ropu - Added Google Checkout $
  14. */
  15. ?>
  16. <div class="centerColumn" id="shoppingCartDefault">
  17. <?php
  18. if ($flagHasCartContents) {
  19. ?>
  20. <?php
  21. if ($_SESSION['cart']->count_contents() > 0) {
  22. ?>
  23. <div class="forward"><?php echo TEXT_VISITORS_CART; ?></div>
  24. <?php
  25. }
  26. ?>
  27. <h1 id="cartDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
  28. <?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>
  29. <?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
  30. <div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION; ?></div>
  31. <?php if (!empty($totalsDisplay)) { ?>
  32. <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
  33. <br class="clearBoth" />
  34. <?php } ?>
  35. <?php if ($flagAnyOutOfStock) { ?>
  36. <?php if (STOCK_ALLOW_CHECKOUT == 'true') { ?>
  37. <div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>
  38. <?php } else { ?>
  39. <div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>
  40. <?php } //endif STOCK_ALLOW_CHECKOUT ?>
  41. <?php } //endif flagAnyOutOfStock ?>
  42. <table border="0" width="100%" cellspacing="0" cellpadding="0" id="cartContentsDisplay">
  43. <tr class="tableHeading">
  44. <th scope="col" id="scQuantityHeading"><?php echo TABLE_HEADING_QUANTITY; ?></th>
  45. <th scope="col" id="scUpdateQuantity">&nbsp;</th>
  46. <th scope="col" id="scProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
  47. <th scope="col" id="scUnitHeading"><?php echo TABLE_HEADING_PRICE; ?></th>
  48. <th scope="col" id="scTotalHeading"><?php echo TABLE_HEADING_TOTAL; ?></th>
  49. <th scope="col" id="scRemoveHeading">&nbsp;</th>
  50. </tr>
  51. <!-- Loop through all products /-->
  52. <?php
  53. foreach ($productArray as $product) {
  54. ?>
  55. <tr class="<?php echo $product['rowClass']; ?>">
  56. <td class="cartQuantity">
  57. <?php
  58. if ($product['flagShowFixedQuantity']) {
  59. echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
  60. } else {
  61. echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
  62. }
  63. ?>
  64. </td>
  65. <td class="cartQuantityUpdate">
  66. <?php
  67. if ($product['buttonUpdate'] == '') {
  68. echo '' ;
  69. } else {
  70. echo $product['buttonUpdate'];
  71. }
  72. ?>
  73. </td>
  74. <td class="cartProductDisplay">
  75. <a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
  76. <br class="clearBoth" />
  77. <?php
  78. echo $product['attributeHiddenField'];
  79. if (isset($product['attributes']) && is_array($product['attributes'])) {
  80. echo '<div class="cartAttribsList">';
  81. echo '<ul>';
  82. reset($product['attributes']);
  83. foreach ($product['attributes'] as $option => $value) {
  84. ?>
  85. <li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>
  86. <?php
  87. }
  88. echo '</ul>';
  89. echo '</div>';
  90. }
  91. ?>
  92. </td>
  93. <td class="cartUnitDisplay"><?php echo $product['productsPriceEach']; ?></td>
  94. <td class="cartTotalDisplay"><?php echo $product['productsPrice']; ?></td>
  95. <td class="cartRemoveItemDisplay">
  96. <?php
  97. if ($product['buttonDelete']) {
  98. ?>
  99. <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>
  100. <?php
  101. }
  102. if ($product['checkBoxDelete'] ) {
  103. echo zen_draw_checkbox_field('cart_delete[]', $product['id']);
  104. }
  105. ?>
  106. </td>
  107. </tr>
  108. <?php
  109. } // end foreach ($productArray as $product)
  110. ?>
  111. <!-- Finished loop through all products /-->
  112. </table>
  113. <div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?></div>
  114. <br class="clearBoth" />
  115. <!--bof shopping cart buttons-->
  116. <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></div>
  117. <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT) . '</a>'; ?></div>
  118. <?php
  119. // show update cart button
  120. if (SHOW_SHOPPING_CART_UPDATE == 2 or SHOW_SHOPPING_CART_UPDATE == 3) {
  121. ?>
  122. <div class="buttonRow back"><?php echo zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT); ?></div>
  123. <?php
  124. } else { // don't show update button below cart
  125. ?>
  126. <?php
  127. } // show update button
  128. ?>
  129. <!--eof shopping cart buttons-->
  130. </form>
  131. <br class="clearBoth" />
  132. <?php
  133. if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {
  134. ?>
  135. <div class="buttonRow back"><?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_SHIPPING_ESTIMATOR) . '\')">' .
  136. zen_image_button(BUTTON_IMAGE_SHIPPING_ESTIMATOR, BUTTON_SHIPPING_ESTIMATOR_ALT) . '</a>'; ?></div>
  137. <?php
  138. }
  139. ?>
  140. <!-- * BEGIN GOOGLE CHECKOUT * -->
  141. <?php
  142. // ** GOOGLE CHECKOUT **
  143. include(DIR_WS_MODULES . 'show_google_components.php');
  144. // ** END GOOGLE CHECKOUT **
  145. ?>
  146. <!-- * END GOOGLE CHECKOUT * -->
  147. <!-- ** BEGIN PAYPAL EXPRESS CHECKOUT ** -->
  148. <?php // the tpl_ec_button template only displays EC option if cart contents >0 and value >0
  149. if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
  150. include(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/tpl_ec_button.php');
  151. }
  152. ?>
  153. <!-- ** END PAYPAL EXPRESS CHECKOUT ** -->
  154. <?php
  155. if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '2') {
  156. /**
  157. * load the shipping estimator code if needed
  158. */
  159. ?>
  160. <?php require(DIR_WS_MODULES . zen_get_module_directory('shipping_estimator.php')); ?>
  161. <?php
  162. }
  163. ?>
  164. <?php
  165. } else {
  166. ?>
  167. <h2 id="cartEmptyText"><?php echo TEXT_CART_EMPTY; ?></h2>
  168. <?php
  169. $show_display_shopping_cart_empty = $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);
  170. while (!$show_display_shopping_cart_empty->EOF) {
  171. ?>
  172. <?php
  173. if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_FEATURED_PRODUCTS') { ?>
  174. <?php
  175. /**
  176. * display the Featured Products Center Box
  177. */
  178. ?>
  179. <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>
  180. <?php } ?>
  181. <?php
  182. if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_SPECIALS_PRODUCTS') { ?>
  183. <?php
  184. /**
  185. * display the Special Products Center Box
  186. */
  187. ?>
  188. <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>
  189. <?php } ?>
  190. <?php
  191. if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_NEW_PRODUCTS') { ?>
  192. <?php
  193. /**
  194. * display the New Products Center Box
  195. */
  196. ?>
  197. <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
  198. <?php } ?>
  199. <?php
  200. if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_UPCOMING') {
  201. include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS));
  202. }
  203. ?>
  204. <?php
  205. $show_display_shopping_cart_empty->MoveNext();
  206. } // !EOF
  207. ?>
  208. <?php
  209. }
  210. ?>
  211. </div>