Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Posts
    35
    Plugin Contributions
    1

    cart error Shopping Cart Totals in Header Support

    the given code for the Shopping Cart Totals in Header Add-On displays the number of products in the cart and not the total quantity of products.

    Example, shopper has 1 qty of (product A) and 2 qty of (product B) but "My Cart" shows (2) items, not the total quantity of 3.
    Likewise a qty of 1 or 30 of Product A still shows 1 item.

    Its a little misleading to the shopper when qty of items and products mean different things.

    How can this be adjusted?

    Code:
    <li><span class="style1">My Cart: 
    	<?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>

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Shopping Cart Totals in Header Support

    That mod uses an incorrect source for its count. The Shoppingcart/Freeship in Header mod, and the "Cart Sidebox with Free Shipping Qualifier and Checkout Button" mod it is based on, use a different method for getting the item count. I just tested it, and it does account for two items of one product.
    PHP Code:
    $cart_count $_SESSION['cart']->count_contents(); 

  3. #3
    Join Date
    Jan 2010
    Posts
    35
    Plugin Contributions
    1

    Default Re: Shopping Cart Totals in Header Support

    Thank you! It took me a few tries to properly adjust the code but this is what finally worked for me:

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

  4. #4
    Join Date
    Jan 2010
    Posts
    35
    Plugin Contributions
    1

    Default Re: Shopping Cart Totals in Header Support

    Quote Originally Posted by georgiepants View Post
    the given code for the Shopping Cart Totals in Header Add-On displays the number of products in the cart and not the total quantity of products.

    Example, shopper has 1 qty of (product A) and 2 qty of (product B) but "My Cart" shows (2) items, not the total quantity of 3.
    Likewise a qty of 1 or 30 of Product A still shows 1 item.

    Its a little misleading to the shopper when qty of items and products mean different things.

    How can this be adjusted?

    Code:
    <li><span class="style1">My Cart: 
    	<?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>
    Quote Originally Posted by gjh42 View Post
    That mod uses an incorrect source for its count. The Shoppingcart/Freeship in Header mod, and the "Cart Sidebox with Free Shipping Qualifier and Checkout Button" mod it is based on, use a different method for getting the item count. I just tested it, and it does account for two items of one product.
    PHP Code:
    $cart_count $_SESSION['cart']->count_contents(); 
    Quote Originally Posted by georgiepants View Post
    Thank you! It took me a few tries to properly adjust the code but this is what finally worked for me:

    Code:
    <li><span class="style1">My Cart: 
    	<?php echo ($_SESSION['cart']->count_contents()); 
    
     ?> &nbsp;items&nbsp;&nbsp;
     	<?php $header_cart = $currencies->format($_SESSION['cart']->show_total());  
    	echo $header_cart;
    	?>
    </span>
    <br class="clearBoth" />
    </li>
    just posting all together to print solution, thanks!

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Shopping Cart Totals in Header Support

    I have submitted a corrected version (1.1) of the mod to Free Addons. Until it is activated, I will attach it here. I do not intend to further support this mod, but refer anyone with questions to the Shoppingcart/Freeship in Header mod and its support thread.
    Last edited by gjh42; 9 Feb 2010 at 01:28 AM.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

 

 

Similar Threads

  1. Shopping Cart Totals in Header - can I make it a hyperlink?
    By top hatt in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 3 Aug 2011, 12:39 AM
  2. 'Shopping Cart Totals in Header' Clickable
    By rrzc in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 19 Aug 2010, 12:53 AM
  3. Shopping cart totals in header customization
    By rrzc in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 8 Jun 2010, 07:29 PM
  4. Shopping Cart on the header section with multi-language support
    By SteveDuncan in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 16 Feb 2010, 02:00 AM
  5. Shopping Cart Totals ??
    By AvieLF in forum General Questions
    Replies: 5
    Last Post: 19 Dec 2006, 09:09 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