Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1
    Join Date
    Jul 2005
    Posts
    57
    Plugin Contributions
    0

    Default Shopping cart in header

    help i have searched every piece in the forum and found nothing on adding the shopping cart in the header. i know it can be done with 1.3 because i have seen it done can anyone help me with this.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    Code:
    <?php
        if (SHOW_TOTALS_IN_CART == '0') {
          echo TEXT_TOTAL_ITEMS . '&nbsp;&nbsp;' . $_SESSION['cart']->count_contents() . '&nbsp;&nbsp;&nbsp;&nbsp;' . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
        } 
    ?>

  3. #3
    Join Date
    Jul 2005
    Posts
    57
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    thank you kim you rock that is why i needed

  4. #4
    Join Date
    Oct 2005
    Posts
    16
    Plugin Contributions
    0

    Re: Shopping cart in header

    I tried adding the lines above to tpl.header.php but the cart total is not showing in the header. Do I need to do anything else?

    thank you,

    lbrown

  5. #5
    Join Date
    Jun 2006
    Posts
    39
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    Hi,

    I changed a few bits and use this code.

    tpl_header ->

    <?php if ($_SESSION['cart']->count_contents() > 0) {
    $products = $_SESSION['cart']->get_products();
    echo '<p><a href="/index.php?main_page=shopping_cart">' . $_SESSION['cart']->count_contents().' Item(s) - Total: £';
    echo $currencies->format($_SESSION['cart']->show_total());
    }

    if ($_SESSION['cart']->count_contents() == 0) {
    $products = $_SESSION['cart']->get_products();
    echo '<p><a href="/index.php?main_page=shopping_cart"> Item(s) £0.00';
    }

    ?></a></p>

    Hope this helps.

  6. #6
    Join Date
    Oct 2006
    Location
    Scotland
    Posts
    55
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    Kims' code does work but only if you have set your admin settings (configuration>layout settings>Shopping Cart (show totals) to 0, ie OFF. You can easily change this by removing the IF statement altogether so the basket summary always shows in the header OR change the code to read

    <?php
    if (SHOW_TOTALS_IN_CART != '0') {
    echo TEXT_TOTAL_ITEMS . '&nbsp;&nbsp;' . $_SESSION['cart']->count_contents() . '&nbsp;&nbsp;&nbsp;&nbsp;' . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
    }
    ?>

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

    Default Re: Shopping cart in header

    Ok - Im going to show how little I know about this stuff....

    Where should I paste this code in order to show the cart summary in my header section ?

    Help would be a life saver !



    Jaz

  8. #8
    Join Date
    Oct 2006
    Location
    Scotland
    Posts
    55
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    You should update the file includes/templates/template_default/common/tpl_header.php and place in your override directory (ie includes/templates/yourOverrideDirectory/common).

  9. #9
    Join Date
    Aug 2006
    Posts
    66
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    thanks sparkle

  10. #10
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Shopping cart in header

    Hey everyone,

    I am only getting the total number of different products in the cart. Although, many of my products are quantity based. Is there a way to edit the total number to be of quantity products, and not just products??

    thanks in advance.
    Code:
    <li>My Cart: <span class="style1">
    	<?php echo sizeof($_SESSION['cart']->get_products()); ?> &nbsp;items&nbsp;&nbsp;
     	<?php $header_cart = $currencies->format($_SESSION['cart']->show_total());  
    	echo $header_cart;
    	?>
    </span>
    <br class="clearBoth" />
    </li>

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v150 Add a View Cart link to my shopping cart header, in 12leaves template?
    By Serg in forum All Other Contributions/Addons
    Replies: 10
    Last Post: 22 Aug 2012, 02:49 AM
  2. 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
  3. Show number of products in cart by shopping cart in header
    By robertwhitis in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 27 Mar 2011, 07:15 PM
  4. Shopping Cart in Header
    By autoace in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Nov 2009, 07:18 PM
  5. Shopping cart in header
    By rascald in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Jun 2009, 12:25 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