Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Location
    Lincolnshire, UK
    Posts
    20
    Plugin Contributions
    0

    Default shopping cart box Items- issues

    Hey all,Yet another post.. my problem now is that I would like my shopping bag to list how many items are in the bag and then the overall price. I have included the code below, Im almost there, just need 1 last push.
    1. This is the template/sideboxes/tpl_shopping cart
    PHP Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2007 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.php 7192 2007-10-06 13:30:46Z drbyte $
     */
      
    $content ="";

      
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="shoppingsideBoxContent">';
      if (
    $_SESSION['cart']->count_contents() > 0) {
      
    $content .= '<div id="cartBoxListWrapper">' "\n" '<ul>' "\n";
        
    $products $_SESSION['cart']->get_products();
        for (
    $i=0$n=sizeof($products); $i<$n$i++) {
          
    $content .= '<li>';

    if (isset(
    $_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            
    $content .= '<span class="cartNewItem">';
          } else {
            
    $content .= '<span class="cartOldItem">';
          }

        
    $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']) . '">';

          if (isset(
    $_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            
    $content .= '<span class="cartNewItem">';
          } else {
            
    $content .= '<span class="cartOldItem">';
          }

         
    /** $content .= $products[$i]['name'] . '</span></a></li>' . "\n";**/

          
    if (isset($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            
    $_SESSION['new_products_id_in_cart'] = '';
          }
        }
        
    $content .= '</ul>' "\n" '</div>';
      } else {
        
    $content .= '<div id="cartBoxEmpty">' BOX_SHOPPING_CART_EMPTY '</div>';
      }

      if (
    $_SESSION['cart']->count_contents() > 0) {
        
    $content .= '<hr />';
        
    $content .= '<div class="cartBoxTotal">' $currencies->format($_SESSION['cart']->show_total()) . '</div>';
        
    $content .= '<br class="clearBoth" />';
      }

      
    /**if (isset($_SESSION['customer_id'])) {
        $gv_query = "select amount
                     from " . TABLE_COUPON_GV_CUSTOMER . "
                     where customer_id = '" . $_SESSION['customer_id'] . "'";
       $gv_result = $db->Execute($gv_query);

        if ($gv_result->RecordCount() && $gv_result->fields['amount'] > 0 ) {
          $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>';
          $content .= '<div id="cartBoxVoucherBalance">' . VOUCHER_BALANCE . $currencies->format($gv_result->fields['amount']) . '</div>';
        }
      }
      $content .= '</div>';**/
    ?>
    2. and this is the modules/sideboxes/template/shopping_cart.php

    PHP Code:
    <?php
    /**
     * shopping_cart sidebox - displays contents of customer's shopping cart.  Also shows GV balance, if any.
     *
     * @package templateSystem
     * @copyright Copyright 2003-2007 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: shopping_cart.php 7437 2007-11-16 21:33:16Z drbyte $
     */

      
    switch (true) {
        case (
    SHOW_SHOPPING_CART_BOX_STATUS == '0'):
          
    $show_shopping_cart_box true;
          break;
        case (
    SHOW_SHOPPING_CART_BOX_STATUS == '1'):
          if (
    $_SESSION['cart']->count_contents() > || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0)) {
            
    $show_shopping_cart_box true;
          } else {
            
    $show_shopping_cart_box false;
          }
          break;
        case (
    SHOW_SHOPPING_CART_BOX_STATUS == '2'):
          if ( ( (isset(
    $_SESSION['cart']) && $_SESSION['cart']->count_contents() > 0) || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0) ) && ($_GET['main_page'] != FILENAME_SHOPPING_CART) ) {
            
    $show_shopping_cart_box true;
          } else {
            
    $show_shopping_cart_box false;
          }
          break;
        }


      if (
    $show_shopping_cart_box == true) {
        require(
    $template->get_template_dir('tpl_shopping_cart.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_shopping_cart.php');
        
    $title =  BOX_HEADING_SHOPPING_CART;
        
    $title_link false;
        
    $title_link FILENAME_SHOPPING_CART;

        require(
    $template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
      }
    ?>
    Thanks in advance.

    website is vanillaclothes.co.uk

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: shopping cart box Items- issues


  3. #3
    Join Date
    Apr 2010
    Location
    Lincolnshire, UK
    Posts
    20
    Plugin Contributions
    0

    Default Re: shopping cart box Items- issues

    Quote Originally Posted by Develop&Promote View Post

    PHP Code:
      $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="shoppingsideBoxContent">';
      if (
    $_SESSION['cart']->count_contents() > 0) {
      
    $content .= '<div id="cartBoxListWrapper">' "\n" '<ul>' "\n";
        
    $products $_SESSION['cart']->get_products();
        for (
    $i=0$n=sizeof($products); $i<$n$i++) {
          
    $content .= '<li>'

    I am sure the code is around here somewhere.
    I really need to spend some more time studying php.

    Please help.

  4. #4
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: shopping cart box Items- issues


 

 

Similar Threads

  1. Shopping Cart and Items in Cart in the Header
    By sendmenews in forum General Questions
    Replies: 10
    Last Post: 25 Oct 2011, 02:09 AM
  2. Layout Issues in Shopping Cart
    By connexionpr in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Jul 2011, 01:34 PM
  3. Shopping Cart Issues
    By danbm in forum Basic Configuration
    Replies: 4
    Last Post: 22 Oct 2010, 10:30 PM
  4. Add checkout link to shopping cart side box below items
    By Makoshark in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 16 Jun 2009, 04:58 PM
  5. Cart Items Spacing Issues
    By UranusApparel in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 31 Mar 2009, 11:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR