Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Posts
    35
    Plugin Contributions
    0

    Default Display product info in the left sidebar

    Hey everyone, I am trying to display some of the product information in the sidebars. I just copied over a few pieces of code from tpl_product_info_display into tpl_box_default_left and right, and it seems to work well in the right sidebar, but not in the left. For example, I can get the product price to show up, but not the product image or the attributes.
    I'm pretty sure it has to do with the order that the page elements are generated, but I can't figure out where the variables for product image and attributes are defined. Can anyone shed some light on this? Thanks,

    JW

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Display product info in the left sidebar

    They're defined for the tpl_product_info_display template in includes/modules/pages/product_info/main_template_vars.php. But the variables processed there will only be available on the product_info page.

    Depending upon when you want to display them, you may have to extract them from the database and prepare them yourself. The product sideboxes show how.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jun 2009
    Posts
    35
    Plugin Contributions
    0

    Default Re: Display product info in the left sidebar

    Thanks. That seems to work fine, except now I am getting more than one of each of these things in the sidebar. The order is going like this:

    Image
    Attributes
    Image
    Attributes
    Attributes

    But I only have them displayed in the code one time. Any idea why multiple instances are being output?

    Here is the code in case it will clear things up:


    Code:
    <!--JW - modified sidebar to display product information-->
    <?php 
    if ($_GET['main_page'] == 'product_info') 
    { ?>
    
    <?php
    
     $sql = "select p.products_id, pd.products_name, pd.products_description, pd.products_description2, pd.products_description3, p.products_model, p.products_quantity, p.products_image,
                      pd.products_url, p.products_price,
                      p.products_tax_class_id, p.products_date_added,
                      p.products_date_available, p.manufacturers_id, p.products_quantity,
                      p.products_weight, p.products_priced_by_attribute, p.product_is_free,
                      p.products_qty_box_status,
                      p.products_quantity_order_max,
                      p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter
               from   " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
               where  p.products_status = '1'
               and    p.products_id = '" . (int)$_GET['products_id'] . "'
               and    pd.products_id = p.products_id
               and    pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    
        $product_info = $db->Execute($sql);
    
    if ($product_info->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
        $products_image = PRODUCTS_IMAGE_NO_IMAGE;
      } else {
        $products_image = $product_info->fields['products_image'];
      }
    
    // set flag for attributes module usage:
        $flag_show_weight_attrib_for_this_prod_type = SHOW_PRODUCT_INFO_WEIGHT_ATTRIBUTES;
    // get attributes
        require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_ATTRIBUTES));
    
    ?>
    
    <div id="sidebar_mod">
    
    <!--bof Main Product Image -->
    <?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>
    <!--eof Main Product Image-->
    
    <br class="clearBoth" />
    
    <!--bof Attributes Module-->
    <?php
      if ($pr_attr->fields['total'] > 0) {
    ?>
    <?php
    /**
     * display the product attributes
     */
      require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
    <?php
      }
    ?>
    <!-- eof Attributes Module -->
    
    </div><!--end sidebar mod-->
    
    <?php } else { ?>
    
    <!--End modified sidebar-->
    ...then the original sidebar code

 

 

Similar Threads

  1. How can I display the category descriptiong text on the product display info page?
    By HellMind in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 18 Sep 2009, 06:43 AM
  2. Display info on product info related with the category
    By HellMind in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 20 Aug 2009, 09:34 PM
  3. How to Remove the Left Column from the Product Info Display Page??
    By autoace in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 20 Aug 2009, 03:37 PM
  4. Moving the product info image from left to right
    By TheMysticAngel in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 8 Jun 2009, 03:49 PM
  5. Stop sidebar banner display on product info pages
    By matt123 in forum Basic Configuration
    Replies: 1
    Last Post: 4 Jan 2008, 08:57 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