Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Posts
    7
    Plugin Contributions
    0

    Default Number of Items in Cart

    I want to add to the header "Number of Items in Cart " function to show: shopping cart: 0 items $0.00. Please advise

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Number of Items in Cart

    There is already a setting for the shopping_cart page to show totals ...

    Check your setting in the Configuration ... Layout Settings ...
    Shopping Cart - Show Totals
    Show Totals Above Shopping Cart?
    0= off
    1= on: Items Weight Amount
    2= on: Items Weight Amount, but no weight when 0
    3= on: Items Amount
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: Number of Items in Cart

    I am not talking about the side box, I want the script to add to site_header file that will include the items in cart function

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Number of Items in Cart

    That is not for the sidebox that is for the shopping cart page ...

    The header_php.php file for the shopping_cart has the following information in how it builds the totals that are displayed at the top of that page that may help you ...
    Code:
    /*
      $shipping_weight = 0;
      require(DIR_WS_CLASSES . 'order.php');
      $order = new order;
      require_once('includes/classes/http_client.php'); // shipping in basket
      $total_weight = $_SESSION['cart']->show_weight();
      $total_count = $_SESSION['cart']->count_contents();
      require(DIR_WS_CLASSES . 'shipping.php');
      $shipping_modules = new shipping;
      $quotes = $shipping_modules->quote();
    */
    $totalsDisplay = '';
    switch (true) {
      case (SHOW_TOTALS_IN_CART == '1'):
      $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
      case (SHOW_TOTALS_IN_CART == '2'):
      $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($shipping_weight > 0 ? TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
      case (SHOW_TOTALS_IN_CART == '3'):
      $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
    }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Aug 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: Number of Items in Cart

    Again I ma not talking about the shopping cart page itself, but the header of the site, If you look at the attached image you'll see in the header right below the search a line that says:

    shopping cart: 0 items $0.00

    That is the function I want to add to my header, thanks again
    Attached Images Attached Images  

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Number of Items in Cart

    And I just gave you the code that is used on the shopping_cart page that you could use in the header of your shop and customize it to always show the shopping cart totals ...

    Other than write all the code for you and load it to your site ... what is missing here?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Aug 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: Number of Items in Cart

    I am sorry, I did not make myself clear. In the admin portion there is a space under: Design-> Upload Design Date called Design Banner 1: I need the actual script that will pull the info I wanted as in the image to show the items in cart etc. I entered a script for the search box and I need one for the cart items one.

  8. #8
    Join Date
    Aug 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: Number of Items in Cart

    The script you gave me I have already, but I need a way to pull that info and present it in the header

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Number of Items in Cart

    I posted the code above that contains the explination of the code and 3 different methods to display the Shopping Cart Totals ...

    Pick one of the methods that you like, or build your own line of totals from what is in the code, and add it to your customized templates and overrides so it shows in the header file where you want to see it ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Number of items in cart by attribute
    By damiantaylor in forum General Questions
    Replies: 0
    Last Post: 29 Aug 2010, 06:42 PM
  2. Number of Items in Cart
    By brotherhud in forum Basic Configuration
    Replies: 1
    Last Post: 9 Nov 2006, 11:39 PM

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