[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/templates/template_default/sideboxes/ -> tpl_shopping_cart.php (source)

   1  <?php
   2  /**

   3   * Side Box Template

   4   *

   5   * @package templateSystem

   6   * @copyright Copyright 2003-2005 Zen Cartt Development Team

   7   * @copyright Portions Copyright 2003 osCommerce

   8   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

   9   * @version $Id: tpl_shopping_cart.php 4821 2006-10-23 10:54:15Z drbyte $

  10   */
  11    $content ="";
  12  
  13    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  14    if ($_SESSION['cart']->count_contents() > 0) {
  15    $content .= '<div id="cartBoxListWrapper">' . "\n" . '<ul>' . "\n";
  16      $products = $_SESSION['cart']->get_products();
  17      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  18        $content .= '<li>';
  19  
  20        if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
  21          $content .= '<span class="cartNewItem">';
  22        } else {
  23          $content .= '<span class="cartOldItem">';
  24        }
  25  
  26        $content .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER . '</span><a href="' . zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">';
  27  
  28        if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
  29          $content .= '<span class="cartNewItem">';
  30        } else {
  31          $content .= '<span class="cartOldItem">';
  32        }
  33  
  34        $content .= $products[$i]['name'] . '</span></a></li>' . "\n";
  35  
  36        if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
  37          $_SESSION['new_products_id_in_cart'] = '';
  38        }
  39      }
  40      $content .= '</ul>' . "\n" . '</div>';
  41    } else {
  42      $content .= '<div id="cartBoxEmpty">' . BOX_SHOPPING_CART_EMPTY . '</div>';
  43    }
  44  
  45    if ($_SESSION['cart']->count_contents() > 0) {
  46      $content .= '<hr />';
  47      $content .= '<div class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';
  48      $content .= '<br class="clearBoth" />';
  49    }
  50  
  51    if (isset($_SESSION['customer_id'])) {
  52      $gv_query = "select amount
  53                   from " . TABLE_COUPON_GV_CUSTOMER . "
  54                   where customer_id = '" . $_SESSION['customer_id'] . "'";
  55     $gv_result = $db->Execute($gv_query);
  56  
  57      if ($gv_result->RecordCount() && $gv_result->fields['amount'] > 0 ) {
  58        $content .= '<div id="cartBoxGVButton"><a href="' . zen_href_link(FILENAME_GV_SEND, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_SEND_A_GIFT_CERT , BUTTON_SEND_A_GIFT_CERT_ALT) . '</a></div>';
  59        $content .= '<div id="cartBoxVoucherBalance">' . VOUCHER_BALANCE . $currencies->format($gv_result->fields['amount']) . '</div>';
  60      }
  61    }
  62    $content .= '</div>';
  63  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics