[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/boxes/ -> shopping_cart.php (source)

   1  <?php
   2  /*

   3  $Id: shopping_cart.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13  // Most of this file is changed or moved to BTS - Basic Template System - format.

  14  
  15  ?>
  16  
  17  <?php if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache') ) {
  18        echo "<%CART_CACHE%>";
  19        } else {
  20  ?>
  21  <!-- shopping_cart //-->
  22  
  23  <script language="javascript"><!--
  24  function couponpopupWindow(url) {
  25  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
  26  }
  27  //--></script> 

  28  
  29  <?php
  30  
  31    $boxHeading = BOX_HEADING_SHOPPING_CART;
  32    $corner_left = 'square';
  33    $corner_right = 'rounded';
  34    $boxLink = '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><img src="images/infobox/arrow_right.gif" border="0" alt="more" title="more" width="12" height="10"></a>';
  35    $box_base_name = 'shopping_cart'; // for easy unique box template setup (added BTSv1.2)

  36    $box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)

  37  
  38    $boxContent = '';
  39    if ($cart->count_contents() > 0) {
  40      $boxContent .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
  41      $products = $cart->get_products();
  42      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  43        $boxContent .= '<tr><td align="right" valign="top" class="infoBoxContents">';
  44  
  45        if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
  46          $boxContent .= '<span class="newItemInCart">';
  47        } else {
  48          $boxContent .= '<span class="infoBoxContents">';
  49        }
  50  
  51        $boxContent .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
  52  
  53        if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
  54          $boxContent .= '<span class="newItemInCart">';
  55        } else {
  56          $boxContent .= '<span class="infoBoxContents">';
  57        }
  58  
  59        $boxContent .= $products[$i]['name'] . '</span></a></td></tr>';
  60  
  61        if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
  62          tep_session_unregister('new_products_id_in_cart');
  63        }
  64      }
  65      $boxContent .= '</table>';
  66    } else {
  67      $boxContent .= BOX_SHOPPING_CART_EMPTY;
  68    }
  69  
  70    if ($cart->count_contents() > 0) {
  71      $boxContent .= tep_draw_separator();
  72      $boxContent .= '<div align="right">' . $currencies->format($cart->show_total()) . '</div>';
  73  
  74    }
  75  // BOF - MOD: CREDIT CLASS Gift Voucher Contribution

  76    if (tep_session_is_registered('customer_id')) {
  77      $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
  78      $gv_result = tep_db_fetch_array($gv_query);
  79      if ($gv_result['amount'] > 0 ) {
  80        $boxContent .= tep_draw_separator();
  81        $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>';
  82        $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>';
  83      }
  84    }
  85    if (tep_session_is_registered('gv_id')) {
  86      $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
  87      $coupon = tep_db_fetch_array($gv_query);
  88      $boxContent .= tep_draw_separator();
  89      $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>';
  90  
  91    }
  92    if (tep_session_is_registered('cc_id') && $cc_id) {
  93      $boxContent .= tep_draw_separator();
  94      $boxContent .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>';
  95  
  96    }
  97  // EOF - MOD: CREDIT CLASS Gift Voucher Contribution

  98  
  99  include (bts_select('boxes', $box_base_name)); // BTS 1.5

 100  
 101    $boxLink = '';
 102  
 103  }
 104  ?>
 105  <!-- shopping_cart_eof //-->


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7