Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default Showing cart items

    I have my cart contents displaying in the header via a jQuery mouseover balloon. It currently displays the number of items in the cart and total. I would like to add the qty and item name as well. Similar to how it displays in the cart sidebox, but truncating it with a "more" link if more than 3 line items. Can someone help?

    Here is my code:
    PHP Code:
    <table border=0 cellpadding=0 width=180 height=100% align=center>
        <tr>
            <td valign=top><strong>Your Cart:</strong><br><?php echo sizeof($_SESSION['cart']->get_products()); ?>&nbsp;Item(s):
         <?php $header_cart $currencies->format($_SESSION['cart']->show_total());  
        echo 
    $header_cart;
        
    ?></td>
        </tr>
        </table>
    I appreciate any help. I'm racking my brain trying to figure it out.

  2. #2
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default Re: Showing cart items

    anyone?

  3. #3
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default Re: Showing cart items

    Still coming up empty :-/

  4. #4
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default Show cart items

    I have my cart contents displaying in the header via a jQuery mouseover balloon. It currently displays the number of items in the cart and total, such as 5 Items | $24.75. I would like to add the qty and item name as well. Similar to how it displays in the cart sidebox, but truncating it with a "more" link if more than 3 line items.

    For example:
    1 x Test Item
    2 x Test Item2
    1 x Test Item3
    more...

    5 Items: $24.75


    Can someone help?

    Here is my code:
    PHP Code:
    <table border=0 cellpadding=0 width=180 height=100% align=center>
        <tr>
            <td valign=top><strong>Your Cart:</strong><br><?php echo sizeof($_SESSION['cart']->get_products()); ?>&nbsp;Item(s):
         <?php $header_cart $currencies->format($_SESSION['cart']->show_total());  
        echo 
    $header_cart;
        
    ?></td>
        </tr>
        </table>
    I appreciate any help. I'm racking my brain trying to figure it out.

  5. #5
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default Re: Showing cart items

    ok here's an update. I borrowed code from tpl_checkout_confirmation_default and it does the trick, however, it doesnt grab the variables until we get to step 1 of 3 of the checkout. If someone is just viewing their cart or just shopping, the items are missing. I know that I probably need to pass the variables, but I'm unsure how. Here's my updated code:
    PHP Code:
    <table cellpadding=0 cellspacing=0>
            <?php for ($i=0$n=sizeof($order->products); $i<$n$i++) { ?>
            <tr>
              <td class="bubbleCartItems"><?php echo $order->products[$i]['qty']; ?>&nbsp;x&nbsp;<?php echo $order->products[$i]['name']; ?></td>
          </tr>
          <?php  }  // end for loopthru all products ?>
          </table>
    I also need to figure out how to cap this at only listing 3 items and show a "more..." link.

  6. #6
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default Re: Showing cart items

    In case anyone wants a look, it's over at www.cutiecardcreations.com/index.php. Mouseover the View Cart link at the top right. It's blank until you get to the checkout process.

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

    Default Re: Showing cart items

    Moderator's Note: The 2 threads for the same topic have been merged.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  8. #8
    Join Date
    Apr 2008
    Posts
    24
    Plugin Contributions
    0

    Default Solution for displaying anyting in tooltip in header shopping cart

    hi

    i was trying to achieve same thing and i have got it with this little piece of code

    PHP Code:
    <!-- $productArray array has every thing in it related to whole shopping cart-->
    <!-- un comment print_r and get any thing you want from this array-->
      <?php //print_r ($productArray);
      
    foreach($productArray as $product)
      {
      
    $proName=$product['productsName'];
      
    $proPriceEach=$product['productsPriceEach'];
      
    //print_r ($proName);
      //print_r ($proPriceEach);
      
    echo "<div id=\"balloonProName\">$proName</div>";
      echo 
    "<div id=\"balloonProPriceEach\">$proPriceEach</div>";
      }
      
    ?>
    then display these divs in the balloon div.
    i have used http://demos111.mootools.net/Tips for balloon tooltip or you can chose from many other
    like
    http://php-ajax-code.##########################/20...d-balloon.html

    hope this helps

    regards
    salman
    Last edited by guls_guys; 17 Jun 2008 at 11:36 PM. Reason: got the title wrong

  9. #9
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default Re: Showing cart items

    guls_guys thanks for the reply.

    Unfortunately, your code is just a different method to what I already have. My problem is that I can only show the number of items in the balloon until I reach the checkout. Only then for some reason will my detailed items show. The same thing happens with your code.

    Here is an updated version of what I have:
    PHP Code:
    <table border="0" cellspacing="0" cellpadding="2" width="180" height="100%" align="center">
        <tr>
            <td valign=top height="15"><strong>Your Cart:</strong><br>
            <!-- START CART ITEMS -->
            <table cellpadding=0 cellspacing=0>
            <?php for ($i=0$n=sizeof($order->products); $i<$n$i++) { ?>
            <tr>
              <td class="bubbleCartItems"><?php echo $order->products[$i]['qty']; ?>&nbsp;x&nbsp;<?php echo $order->products[$i]['name']; ?></td>
          </tr>
          <?php  }  // end for loopthru all products ?>
          </table>
          <!-- END CART ITEMS -->
            </td>
        </tr>
        <tr>
            <td align=right>        
            <?php echo sizeof($_SESSION['cart']->get_products()); ?>&nbsp;Item(s):
         <?php $header_cart $currencies->format($_SESSION['cart']->show_total());  
        echo 
    $header_cart;
        
    ?></td>
        </tr>
        </table>

  10. #10
    Join Date
    Apr 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: Showing cart items

    yes i agree
    this is happening because php data is not loading in tooltip.

    i am working on it, as soon as available i will post it.
    one solution could be using ajax to load an external page in tooltip.

    so fingers crossed

    salman

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 2 Aug 2016, 01:03 PM
  2. v139h Deleting items from shopping cart--error showing
    By DarkAngel in forum General Questions
    Replies: 4
    Last Post: 23 Apr 2013, 05:10 AM
  3. New Items / View All Items: Only showing first letter of product description
    By opengrave in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 22 Feb 2011, 07:57 PM
  4. Shopping Cart not showing up after adding items
    By russa2 in forum General Questions
    Replies: 3
    Last Post: 30 Jan 2009, 03:25 PM
  5. Replies: 4
    Last Post: 14 Dec 2007, 01:04 AM

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