Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default sidebox with images add-on css problem

    i have a problem which has been driving me nuts for the last god knows how long, i am trying to modify the sidebox with images addon.

    on the line which lists the quantity and product name in the shopping cart it splits into two lines, i would like these both to be on the same line (images are reduced to 50% until i have fixed this) ive tried moving the code around but i think it is css affecting it, im normaly pretty sweet with this sort of thing but i think ive gotten into a vicious circle and may need a fresh set of eyes to take a look.

    any help would be very much appreciated, thankyou!!!

    http ://www. livvylou .co.uk

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

    Default Re: sidebox with images add-on css problem

    You don't seem to have this sidebox active, so there's not much we can say about it now.

    If it is a shoppingcart sidebox mod, there are no products to test it with...

  3. #3
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: sidebox with images add-on css problem

    so sorry ive been using hidden categories and direct category links to test while the site is live, i have deactivated it now all products should be visible

    sorry!!

  4. #4
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: sidebox with images add-on css problem

    i think it may well be related to the relative position of the .cartOldItem inthe sidebox. my coding is below if anyone can help?

    tpl_shopping_cart.php

    Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cartt 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 2007-03-15 kuroi $
     */
      $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 (($_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 (($_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 .= zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) . '<br>' . $products[$i]['name'] . '</span></a></li>' . "\n";
    
          if (($_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'] > 0 ) {
          $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>';
    ?>

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

    Default Re: sidebox with images add-on css problem

    I don't know what Kuroi's original code for this looked like, but you seem to have duplicate span classes. The code as posted will put the name under the image without regard to the position of the quantity. If your desire is for the qty and name to line up, you can simplify the code.
    PHP Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cartt 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 2007-03-15 kuroi $ modified by gjh42 2010-02-10
     */
      
    $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 ((
    $_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            
    $content .= '<div class="cartNewItem">';
          } else {
            
    $content .= '<div class="cartOldItem">';
          }

          
    $content .= '<a class="cartImg" href="' zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' $products[$i]['id']) . '">';
          
    $content .= zen_image(DIR_WS_IMAGES $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTHIMAGE_SHOPPING_CART_HEIGHT) . '</a><br>';
          
    $content .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER '<a href="' zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' $products[$i]['id']) . '">' $products[$i]['name'] . '</a>' "\n" '</div></li>' "\n";

          if ((
    $_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>';
    ?>
    This wraps a .cartNewItem or .cartOldItem div around the whole product, then makes a link with class .cartImg for the image, a line break, the quantity and a link for the name.

    The .cartImg class can be used to address just the image for positioning.

  6. #6
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: sidebox with images add-on css problem

    absolutely fantastic thank you very much for your time!!

 

 

Similar Threads

  1. Swap Images via Mouseover or Click Add-on: how to add CSS Style?
    By vojager in forum Templates, Stylesheets, Page Layout
    Replies: 16
    Last Post: 28 Jan 2011, 06:27 PM
  2. CSS for images within a particular sidebox
    By specopkirbs in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Oct 2010, 01:56 PM
  3. Trouble with CSS in a New Sidebox
    By THE-EDL in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 15 Dec 2009, 12:30 PM
  4. Problem with Add'l Images on a Product
    By Seanmyr in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 3 Apr 2009, 10: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