<?php
/*
  $Id: shopping_cart.php,v 1.2 2006/07/16 05:09:34 ryu Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
  
  modified for Koshoten.net2
  http://www.koshoten.net/
*/
?>
<!-- shoppingCart -->
<?php
  $cssid = 'shoppingCartBox';
  $infobox_header = BOX_HEADING_SHOPPING_CART;
  $infobox_footer = '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . BOX_MORE_SHOPPING_CART . '</a>';

  $cart_contents_string = '';
  if ($cart->count_contents() > 0) {
    $cart_contents_string = '<ul class="shoppingCartBoxProducts">' . "\n";
    $products = $cart->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
      $cart_contents_string .= "<li>\n";

      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
        $cart_contents_string .= '<p class="number"><span class="newItemInCart">' . $products[$i]['quantity'] . "&nbsp;x&nbsp;</span></p>\n";
      } else {
        $cart_contents_string .= '<p class="number">' . $products[$i]['quantity'] . "&nbsp;x&nbsp;</p>\n";
      }

      $cart_contents_string .= '<p class="title"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
        $cart_contents_string .= '<span class="newItemInCart">' . $products[$i]['name'] . '</span>';
      } else {
        $cart_contents_string .= $products[$i]['name'];
      }

      $cart_contents_string .= "</a></p>\n";

      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
        tep_session_unregister('new_products_id_in_cart');
      }
      $cart_contents_string .= "</li>\n";
    }
    $cart_contents_string .= "</ul>\n";
    $cart_contents_string .= '<p class="total">' . $currencies->format($cart->show_total()) . "</p>\n";
  } else {
    $cart_contents_string .= '<p class="empty">' . BOX_SHOPPING_CART_EMPTY . "</p>\n";
  }

  $infobox_contents = array();
  $infobox_contents[] = array('text' => $cart_contents_string);

    new infoBox($cssid, $infobox_contents, $infobox_header, $infobox_footer);
?>
<!-- /shoppingCart -->
