Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30
  1. #11
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    It's on a client site that will be released next week but I think he'd be pissed if I linked it publicly at this point in the development. I will definitely make the link available here once the site is published May 1. I will PM you the link.
    Alane

  2. #12
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    A,
    No need, I inserted the .php code, Works like a charm..

    Thanks for your hard work
    Mark
    Hare Do

  3. #13
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    Glad I got to contribute something for the community!
    Alane

  4. #14
    Join Date
    Mar 2008
    Posts
    51
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    alanekilauea, I can't thank you enough! I'm sure the zen-cart community is gonna be very glad ;)

    the curiously MISSING feature of the shopping cart sidebox is finally resolved!

  5. #15
    Join Date
    Mar 2008
    Posts
    51
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    I just got a chance to install the new code and it works great, this was exactly what I wanted.

    But now the only thing is the formatting is a little awkward. Right now it looks something like this:

    1 ea. Shirt, Blue, w/ Hood

    The product's name and all the attributes are connected into a single line, which inevitably starts spilling into the next line and becomes illegible.

    I tried messing around and got it so that each attribute has it's own line and indented so that it looks like this:

    1 ea. Shirt
    Blue
    w/ Hood

    But I can't seem to isolate the actual attribute text for customization. What I'm actually trying to do is put the attributes in bullet points like in the shopping cart (not the sidebox). Can't seem to get this to work, any ideas?

  6. #16
    Join Date
    Mar 2008
    Posts
    51
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    Ok, I won't need to use the <ul><li> tags for bullet points cuz I just worked my way around it instead. Here's what I did:

    With Alane's code pasted in at line 34, line 55 was where I added all my tags for text formatting. Here's my modified line 55:

    PHP Code:
              $content .= '<ul><div style="font-size:75%;">&nbsp;&nbsp;&nbsp;' "-" $attributes->fields['products_options_values_name'] . '</div></ul>'
    With that setup, my attribute format in the shopping cart sidebox now look like this:

    1 ea. Sweatshirt
    -Purple
    -w/ Hood

    Without those huge line breaks between the attributes.

  7. #17
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    Ht,
    Thank for the small coding..

    Please post me the complete file
    1. Just use the [PHP] at the front of the .php file and use ending tag also
    Mark
    Hare Do

  8. #18
    Join Date
    Mar 2008
    Posts
    51
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    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="sideBoxContent">';
      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><br>' "\n";
          
    // BOF Display Attributes //       
      
    if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
        
    reset($products[$i]['attributes']);    
        foreach (
    $products[$i]['attributes'] as $option => $value) {
            while (list(
    $option$value) = each($products[$i]['attributes'])) {
              
    $attributes_query "select popt.products_options_name, poval.products_options_values_name,
                                              pa.options_values_price, pa.price_prefix
                                       from " 
    TABLE_PRODUCTS_OPTIONS " popt,
                                            " 
    TABLE_PRODUCTS_OPTIONS_VALUES " poval,
                                            " 
    TABLE_PRODUCTS_ATTRIBUTES " pa
                                       where pa.products_id = '" 
    . (int)$products[$i]['id'] . "'
                                       and pa.options_id = '" 
    . (int)$option "'
                                       and pa.options_id = popt.products_options_id
                                       and pa.options_values_id = '" 
    . (int)$value "'
                                       and pa.options_values_id = poval.products_options_values_id
                                       and popt.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
                                       and poval.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'";

              
    $attributes $db->Execute($attributes_query);

              
    $content .= '<ul><div style="font-size:75%;">&nbsp;&nbsp;&nbsp;' "-" $attributes->fields['products_options_values_name'] . '</div></ul>';  
              }    
         }
      }
    // EOF Display Attributes //

          
    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'] > ) {
          
    $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>';
    ?>

  9. #19
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    HT,
    SWEET,,, SWEET,,, Thanks for the added work...
    Mark
    Hare Do

  10. #20
    Join Date
    Mar 2008
    Posts
    51
    Plugin Contributions
    0

    Default Re: How to show attributes in shopping cart sidebox?

    hehe, thx, but the big thanks has to go to Alane ;)

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v139h Need to show attributes in shopping cart
    By 4jDesigns in forum General Questions
    Replies: 2
    Last Post: 17 May 2012, 02:06 PM
  2. Remove right sidebox shopping cart from when on shopping cart page
    By alterego55 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 2 Oct 2010, 01:45 AM
  3. Always show shopping cart sidebox
    By numinix in forum Customization from the Admin
    Replies: 3
    Last Post: 9 Mar 2009, 05:39 PM
  4. Show prices of attributes on shopping cart
    By erezw in forum General Questions
    Replies: 1
    Last Post: 4 Mar 2009, 05:56 PM
  5. Show selected attributes in Shopping Cart Box?
    By bigmom in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 16 Oct 2007, 04:40 AM

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