Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Getting the price under the Product Title on category page

    I'm trying to get the price under the product title here is my product_listing page code. I have been trying to make this happen, but getting nowhere. Any help would be greatly appreciated thanks.

    PHP Code:

     <?php
    /** Single Listing template mod v1.8

     * product_listing module
     *
     * @package modules
     * @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: product_listing.php 6787 2007-08-24 14:06:33Z drbyte $
     * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING For Zen Cart v1.3.6 - 10/25/2006
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die(
    'Illegal Access');
    }
    require_once(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE));

    // Column Layout Support originally added for Zen Cart v 1.1.4 by Eric Stamper - 02/14/2004
    // Upgraded to be compatible with Zen-cart v 1.2.0d by Rajeev Tandon - Aug 3, 2004
    // Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006
    //
    if (TEMPLATE_DEBUG == 'True') echo '<br />\includes\modules\TEMPLATE\product_listing.php<br />';//STEVE

    if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE','rows');
    if (!
    defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3);

    if (!isset(
    $PRODUCT_LISTING_COLUMNS_PER_ROW))$PRODUCT_LISTING_COLUMNS_PER_ROW PRODUCT_LISTING_COLUMNS_PER_ROW;

    if (
    TEMPLATE_DEBUG == 'True') echo '$PRODUCT_LISTING_COLUMNS_PER_ROW = ' $PRODUCT_LISTING_COLUMNS_PER_ROW.'<br />';//STEVE
    $row 0;
    $col 0;
    $list_box_contents = array();
    $title '';

    if(
    $is_slt_listing){//SLT load $listing_split with query results
        
    require_once(DIR_WS_CLASSES.'class.single_listing.php');
        
    $listing_split = new singleListing($listing_sql$max_index_listingfalse);//last parameter is for debug of singleListing
    }
    else{
    //default product listing
        
    $max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && $PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? ($PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/$PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;
        
    $listing_split = new splitPageResults($listing_sql$max_results'p.products_id''page'false);//last parameter is for debug of splitPageResults
    }

    $show_submit zen_run_normal();

    $zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT'$listing_split->number_of_rows);
    $how_many 0;

    // Begin Row Layout Header
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') {// For Column Layout (Grid Layout) add on module
    if (TEMPLATE_DEBUG == 'True') echo 'line 50 - PRODUCT_LISTING_LAYOUT_STYLE == rows';//STEVE



    $zc_col_count_description 0;
    $lc_align '';
    for (
    $col=0$n=sizeof($column_list); $col<$n$col++) {
      switch (
    $column_list[$col]) {
        case 
    'PRODUCT_LIST_MODEL':
        
    $lc_text TABLE_HEADING_MODEL;
        
    $lc_align '';
        
    $zc_col_count_description++;
        break;
        case 
    'PRODUCT_LIST_MANUFACTURER':
        
    $lc_text TABLE_HEADING_MANUFACTURER;
        
    $lc_align '';
        
    $zc_col_count_description++;
        break;
        case 
    'PRODUCT_LIST_QUANTITY':
        
    $lc_text TABLE_HEADING_QUANTITY;
        
    $lc_align 'right';
        
    $zc_col_count_description++;
        break;
        case 
    'PRODUCT_LIST_WEIGHT':
        
    $lc_text TABLE_HEADING_WEIGHT;
        
    $lc_align 'right';
        
    $zc_col_count_description++;
        break;

      }

      if ( (
    $column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
        
    $lc_text zen_create_sort_heading($_GET['sort'], $col+1$lc_text);
      }



      
    $list_box_contents[0][$col] = array('align' => $lc_align,
                                          
    'params' => 'class="productListing-heading"',
                                          
    'text' => $lc_text );
    }

    // End Row Layout Header used in Column Layout (Grid Layout) add on module

    /////////////  THE HEADER ROW IS THE CODE ABOVE//////

    $num_products_count $listing_split->number_of_rows;//IF NOT COLUMNS

    if ($listing_split->number_of_rows 0) {
      
    $rows 0;
      
    // Used for Column Layout (Grid Layout) add on module
      
    $column 0;
      if (
    PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
        if (
    $num_products_count $PRODUCT_LISTING_COLUMNS_PER_ROW || $PRODUCT_LISTING_COLUMNS_PER_ROW == ) {
          
    $col_width floor(100/$num_products_count);
        } else {
          
    $col_width floor(100/$PRODUCT_LISTING_COLUMNS_PER_ROW);
        }
      }
      
    // Used for Column Layout (Grid Layout) add on module

        
    if ($is_slt_listing$listing $listing_split->records;//SLT mod, load $listing with results from listing_split
        
    else $listing $db->Execute($listing_split->sql_query);//original, load $listing with results from query stored in listing_split

        
    $extra_row 0;
      while (!
    $listing->EOF) {

        if (
    PRODUCT_LISTING_LAYOUT_STYLE == 'rows') { // Used in Column Layout (Grid Layout) Add on module
        
    $rows++;

        if (((
    $rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
          
    $list_box_contents[$rows] = array('params' => 'class="list_box"');
        } else {
          
    $list_box_contents[$rows] = array('params' => 'class="list_box"');
        }

        
    $cur_row sizeof($list_box_contents) - 1;
        }   
    // End of Conditional execution - only for row (regular style layout)

        
    $product_contents = array(); // Used For Column Layout (Grid Layout) Add on module

        
    for ($col=0$n=sizeof($column_list); $col<$n$col++) {
          
    $lc_align '';
          switch (
    $column_list[$col]) {
            case 
    'PRODUCT_LIST_MODEL':
            
    $lc_align '';
            
    $lc_text '<div class="itemModel">'$listing->fields['products_model'] . '</div>';
            break;
            case 
    'PRODUCT_LIST_NAME'://STEVE for boilerplate text Product Name as a link plus optional truncated description
            
    $lc_align '';
            if (isset(
    $_GET['manufacturers_id'])) {//true if its a manufacturer listing page STEVE bof Boilerplate text
                
    if (!$is_slt_listing) {//normal product listing
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a>';
                } else {
    //Single Listing Template
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</a></div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
                }
            } else {
    //not a manufacturer product listing, but the code loaded into $lc_text is the same in either case!! 
            
    if (!$is_slt_listing) {//normal product listing
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a>';
                } else {
    //Single Listing Template
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
                }
                }
            break;
            case 
    'PRODUCT_LIST_PRICE':
            
    $lc_text .= '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $lc_price '</a>';  
            
    $lc_align 'right';
            
    $lc_text =  $lc_price;

            
    // more info in place of buy now
            
    $lc_button '';
            if (
    zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '1') {
            if (!
    $is_slt_listing) {//normal product listing
              
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            } else {
    //bof Single Listing Template
               
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            }
    //eof Single Listing Template
            
    }

            else {
              if (
    PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
                if (
                    
    // not a hide qty box product
                    
    $listing->fields['products_qty_box_status'] != &&
                    
    // product type can be added to cart
                    
    zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
                    
    &&
                    
    // product is not call for price
                    
    $listing->fields['product_is_call'] == 0
                    
    &&
                    
    // product is in stock or customers may add it to cart anyway
                    
    ($listing->fields['products_quantity'] > || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
                  
    $how_many++;
                }
                
    // hide quantity box
                
    if ($listing->fields['products_qty_box_status'] == 0) {
                  
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                } else {
    //quantity box is shown
                  
    $lc_button TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART "<input type=\"text\" name=\"products_id[" $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
                }
              } else {
    // qty box with add to cart button
                
    if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {//with quantity box
                
    if (!$is_slt_listing) {//normal Product Listing
                  
    $lc_buttonzen_draw_form('cart_quantity'zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' $listing->fields['products_id']), 'post''enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' zen_draw_hidden_field('products_id'$listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT) . '</form>';
                } else {
    //Single Listing Template
                
    $lc_buttonzen_draw_form('cart_quantity'zen_href_link(zen_get_info_page($listing->fields['products_id']), 'action=add_product&products_id=' $listing->fields['products_id']), 'post''enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' zen_draw_hidden_field('products_id'$listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT) . '</form>';
                }
                } else {
    //just the Buy Now button, which goes to the cart but strangely shows a breadcrumb of the product info page, this is default action
                    
    if (!$is_slt_listing) {
                    
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                    }
                    else {
    //Single Listing Template, removed the Manufacturers id in the link.
                    
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                    }
                }
              }
            }
           
         
            break;
            case 
    'PRODUCT_LIST_QUANTITY':
            
    $lc_align 'right';
            
    $lc_text '<div class="itemQuantity">' $listing->fields['products_quantity'] . '</div>';
            break;
            case 
    'PRODUCT_LIST_WEIGHT':
            
    $lc_align 'right';
            
    $lc_text '<div class="itemWeight">' $listing->fields['products_weight'] . ' ' TEXT_PRODUCT_WEIGHT_UNIT '</div>';
            break;
            case 
    'PRODUCT_LIST_IMAGE':
            
    $lc_align 'center';
            if (
    $listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              
    $lc_text '';
            } else {
              if (isset(
    $_GET['manufacturers_id'])) {
                
    $lc_text '<div class="itemImage"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              } elseif (!
    $is_slt_listing) {//normal product listing
                
    $lc_text '<div class="itemImage"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              } else {
    //Single Listing Template
              
    $lc_text '<div class="itemImage"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              }
            }

            break;
          }

          
    $product_contents[] = $lc_text// Used For Column Layout (Grid Layout) Option

          
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') {
          
    $list_box_contents[$rows][$col] = array('align' => $lc_align,
                                                  
    'params' => 'class="main"',
                                                  
    'text'  => $lc_text);
        }
        }

        
    // add description and match alternating colors
        //if (PRODUCT_LIST_DESCRIPTION > 0) {
        //  $rows++;
        //  if ($extra_row == 1) {
        //    $list_box_description = "productListing-data-description-even";
        //    $extra_row=0;
        //  } else {
        //    $list_box_description = "productListing-data-description-odd";
        //    $extra_row=1;
        //  }
        //  $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
        //  'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION));
        //}

        // Following code will be executed only if Column Layout (Grid Layout) option is chosen
        
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
          
    $lc_text implode(''$product_contents);
          
    $list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' ' ' 'style="width:' $col_width '%;"',
                                                     
    'text'  => $lc_text);
          
    $column ++;
          if (
    $column >= $PRODUCT_LISTING_COLUMNS_PER_ROW) {
            
    $column 0;
            
    $rows ++;
          }
        }
        
    // End of Code fragment for Column Layout (Grid Layout) option in add on module
        
    if($is_slt_listing)
            
    $listing->MoveNextRandom();
        else
            
    $listing->MoveNext();
      }
      
    $error_categories false;
    } else {
      
    $list_box_contents = array();

      
    $list_box_contents[0] = array('params' => 'class="productListing-odd"');
      
    $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                                  
    'text' => TEXT_NO_PRODUCTS);

      
    $error_categories true;
    }

    if ((
    $how_many and $show_submit == true and $listing_split->number_of_rows 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == or  PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
      
    $show_top_submit_button true;
    } else {
      
    $show_top_submit_button false;
    }
    if ((
    $how_many and $show_submit == true and $listing_split->number_of_rows 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) {
      
    $show_bottom_submit_button true;
    } else {
      
    $show_bottom_submit_button false;
    }



      if (
    $how_many && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != and $show_submit == true and $listing_split->number_of_rows 0) {
      
    // bof: multiple products
        
    echo zen_draw_form('multiple_products_cart_quantity'zen_href_link(FILENAME_DEFAULTzen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post''enctype="multipart/form-data"');
      }

  2. #2
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Getting the price under the Product Title on category page

    after you fix the code in this post:

    go to ADMIN>CONFIGURATION>PRODUCT LISTING

    set the DISPLAY PRODUCT PRICE?ADD TO CART to (0)

    in your /includes/modules/YOUR_TEMPLATE_NAME/product_listing.php find:

    PHP Code:
    break;
            case 
    'PRODUCT_LIST_PRICE':
            
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
            
    $lc_align 'right';
            
    $lc_text '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>'
    replace with:
    PHP Code:
    break;
             case 
    'PRODUCT_LIST_PRICE':
             
    //$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
             //$lc_align = 'right';
             //$lc_text = '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])   > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > 0 ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' . $listing->fields['products_id']) . '">' .   $lc_price . '</a>'; 
    then find:
    PHP Code:
            break;
            case 
    'PRODUCT_LIST_NAME':
            
    $lc_align '';
            
    $lc_text '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'
    replace with:
    PHP Code:
            break;
            case 
    'PRODUCT_LIST_NAME':
            
    $lc_align '';
            
    $lc_text '<h3 class="itemTitle"><a href="' .  zen_href_link(zen_get_info_page($listing->fields['products_id']),  'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']  > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) :  ($_GET['cPath'] > ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))  . '&products_id=' $listing->fields['products_id']) . '">' .  $listing->fields['products_name'] . '</a></h3><div  class="listingDescription">' .  zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'],  $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .  '</div>';
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
              
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>'

  3. #3
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Getting the price under the Product Title on category page

    Ok I tried the placing your last code and got a blank page then I tried to change it to this and nothing is displaying

    PHP Code:
     break;
            case 
    'PRODUCT_LIST_NAME'://STEVE for boilerplate text Product Name as a link plus optional truncated description
            
    $lc_align '';
            if (isset(
    $_GET['manufacturers_id'])) {//true if its a manufacturer listing page STEVE bof Boilerplate text
                
    if (!$is_slt_listing) {//normal product listing
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a>';
                } else {
    //Single Listing Template
    $lc_text '<h3 class="itemTitle"><a href="' .  zen_href_link(zen_get_info_page($listing->fields['products_id']),  'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']  > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) :  ($_GET['cPath'] > ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))  . '&products_id=' $listing->fields['products_id']) . '">' .  $listing->fields['products_name'] . '</a></h3><div  class="listingDescription">' .  zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'],  $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .  '</div>';
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
              
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';             }
            } else {
    //not a manufacturer product listing, but the code loaded into $lc_text is the same in either case!! 
            
    if (!$is_slt_listing) {//normal product listing
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a>';
                } else {
    //Single Listing Template
    $lc_text '<h3 class="itemTitle"><a href="' .  zen_href_link(zen_get_info_page($listing->fields['products_id']),  'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']  > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) :  ($_GET['cPath'] > ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))  . '&products_id=' $listing->fields['products_id']) . '">' .  $listing->fields['products_name'] . '</a></h3><div  class="listingDescription">' .  zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'],  $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .  '</div>';
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
              
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';             }
                } 

  4. #4
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Getting the price under the Product Title on category page

    Are you coping the code directly from my posts, all the code I post is different then what you repost.

  5. #5
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Getting the price under the Product Title on category page

    Yeah I copied the code and replaced the old code and I got a blank page.

  6. #6
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Getting the price under the Product Title on category page

    This is all the code with the edited code

    PHP Code:
    <?php
    /** Single Listing template mod v1.8

     * product_listing module
     *
     * @package modules
     * @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: product_listing.php 6787 2007-08-24 14:06:33Z drbyte $
     * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING For Zen Cart v1.3.6 - 10/25/2006
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die(
    'Illegal Access');
    }
    require_once(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE));

    // Column Layout Support originally added for Zen Cart v 1.1.4 by Eric Stamper - 02/14/2004
    // Upgraded to be compatible with Zen-cart v 1.2.0d by Rajeev Tandon - Aug 3, 2004
    // Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006
    //
    if (TEMPLATE_DEBUG == 'True') echo '<br />\includes\modules\TEMPLATE\product_listing.php<br />';//STEVE

    if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE','rows');
    if (!
    defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3);

    if (!isset(
    $PRODUCT_LISTING_COLUMNS_PER_ROW))$PRODUCT_LISTING_COLUMNS_PER_ROW PRODUCT_LISTING_COLUMNS_PER_ROW;

    if (
    TEMPLATE_DEBUG == 'True') echo '$PRODUCT_LISTING_COLUMNS_PER_ROW = ' $PRODUCT_LISTING_COLUMNS_PER_ROW.'<br />';//STEVE
    $row 0;
    $col 0;
    $list_box_contents = array();
    $title '';

    if(
    $is_slt_listing){//SLT load $listing_split with query results
        
    require_once(DIR_WS_CLASSES.'class.single_listing.php');
        
    $listing_split = new singleListing($listing_sql$max_index_listingfalse);//last parameter is for debug of singleListing
    }
    else{
    //default product listing
        
    $max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && $PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? ($PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/$PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;
        
    $listing_split = new splitPageResults($listing_sql$max_results'p.products_id''page'false);//last parameter is for debug of splitPageResults
    }

    $show_submit zen_run_normal();

    $zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT'$listing_split->number_of_rows);
    $how_many 0;

    // Begin Row Layout Header
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') {// For Column Layout (Grid Layout) add on module
    if (TEMPLATE_DEBUG == 'True') echo 'line 50 - PRODUCT_LISTING_LAYOUT_STYLE == rows';//STEVE



    $zc_col_count_description 0;
    $lc_align '';
    for (
    $col=0$n=sizeof($column_list); $col<$n$col++) {
      switch (
    $column_list[$col]) {
        case 
    'PRODUCT_LIST_MODEL':
        
    $lc_text TABLE_HEADING_MODEL;
        
    $lc_align '';
        
    $zc_col_count_description++;
        break;
        case 
    'PRODUCT_LIST_MANUFACTURER':
        
    $lc_text TABLE_HEADING_MANUFACTURER;
        
    $lc_align '';
        
    $zc_col_count_description++;
        break;
        case 
    'PRODUCT_LIST_QUANTITY':
        
    $lc_text TABLE_HEADING_QUANTITY;
        
    $lc_align 'right';
        
    $zc_col_count_description++;
        break;
        case 
    'PRODUCT_LIST_WEIGHT':
        
    $lc_text TABLE_HEADING_WEIGHT;
        
    $lc_align 'right';
        
    $zc_col_count_description++;
        break;

      }

      if ( (
    $column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
        
    $lc_text zen_create_sort_heading($_GET['sort'], $col+1$lc_text);
      }



      
    $list_box_contents[0][$col] = array('align' => $lc_align,
                                          
    'params' => 'class="productListing-heading"',
                                          
    'text' => $lc_text );
    }

    // End Row Layout Header used in Column Layout (Grid Layout) add on module

    /////////////  THE HEADER ROW IS THE CODE ABOVE//////

    $num_products_count $listing_split->number_of_rows;//IF NOT COLUMNS

    if ($listing_split->number_of_rows 0) {
      
    $rows 0;
      
    // Used for Column Layout (Grid Layout) add on module
      
    $column 0;
      if (
    PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
        if (
    $num_products_count $PRODUCT_LISTING_COLUMNS_PER_ROW || $PRODUCT_LISTING_COLUMNS_PER_ROW == ) {
          
    $col_width floor(100/$num_products_count);
        } else {
          
    $col_width floor(100/$PRODUCT_LISTING_COLUMNS_PER_ROW);
        }
      }
      
    // Used for Column Layout (Grid Layout) add on module

        
    if ($is_slt_listing$listing $listing_split->records;//SLT mod, load $listing with results from listing_split
        
    else $listing $db->Execute($listing_split->sql_query);//original, load $listing with results from query stored in listing_split

        
    $extra_row 0;
      while (!
    $listing->EOF) {

        if (
    PRODUCT_LISTING_LAYOUT_STYLE == 'rows') { // Used in Column Layout (Grid Layout) Add on module
        
    $rows++;

        if (((
    $rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
          
    $list_box_contents[$rows] = array('params' => 'class="list_box"');
        } else {
          
    $list_box_contents[$rows] = array('params' => 'class="list_box"');
        }

        
    $cur_row sizeof($list_box_contents) - 1;
        }   
    // End of Conditional execution - only for row (regular style layout)

        
    $product_contents = array(); // Used For Column Layout (Grid Layout) Add on module

        
    for ($col=0$n=sizeof($column_list); $col<$n$col++) {
          
    $lc_align '';
          switch (
    $column_list[$col]) {
            case 
    'PRODUCT_LIST_MODEL':
            
    $lc_align '';
            
    $lc_text '<div class="itemModel">'$listing->fields['products_model'] . '</div>';
            break;
            case 
    'PRODUCT_LIST_NAME':
            
    $lc_align '';
            
    $lc_text '<h3 class="itemTitle"><a href="' .  zen_href_link(zen_get_info_page($listing->fields['products_id']),  'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']  > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) :  ($_GET['cPath'] > ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))  . '&products_id=' $listing->fields['products_id']) . '">' .  $listing->fields['products_name'] . '</a></h3><div  class="listingDescription">' .  zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'],  $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .  '</div>';
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
              
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';  
              
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';  
                } else {
    //Single Listing Template
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</a></div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
                }
            } else {
    //not a manufacturer product listing, but the code loaded into $lc_text is the same in either case!! 
            
    if (!$is_slt_listing) {//normal product listing
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a>';
                } else {
    //Single Listing Template
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
                }
                }
           break;
    break;
             case 
    'PRODUCT_LIST_PRICE':
             
    //$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
             //$lc_align = 'right';
             //$lc_text = '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'])   > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > 0 ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' . $listing->fields['products_id']) . '">' .   $lc_price . '</a>';  

            // more info in place of buy now
            
    $lc_button '';
            if (
    zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '1') {
            if (!
    $is_slt_listing) {//normal product listing
              
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            } else {
    //bof Single Listing Template
               
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            }
    //eof Single Listing Template
            
    }

            else {
              if (
    PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
                if (
                    
    // not a hide qty box product
                    
    $listing->fields['products_qty_box_status'] != &&
                    
    // product type can be added to cart
                    
    zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
                    
    &&
                    
    // product is not call for price
                    
    $listing->fields['product_is_call'] == 0
                    
    &&
                    
    // product is in stock or customers may add it to cart anyway
                    
    ($listing->fields['products_quantity'] > || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
                  
    $how_many++;
                }
                
    // hide quantity box
                
    if ($listing->fields['products_qty_box_status'] == 0) {
                  
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                } else {
    //quantity box is shown
                  
    $lc_button TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART "<input type=\"text\" name=\"products_id[" $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
                }
              } else {
    // qty box with add to cart button
                
    if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {//with quantity box
                
    if (!$is_slt_listing) {//normal Product Listing
                  
    $lc_buttonzen_draw_form('cart_quantity'zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' $listing->fields['products_id']), 'post''enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' zen_draw_hidden_field('products_id'$listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT) . '</form>';
                } else {
    //Single Listing Template
                
    $lc_buttonzen_draw_form('cart_quantity'zen_href_link(zen_get_info_page($listing->fields['products_id']), 'action=add_product&products_id=' $listing->fields['products_id']), 'post''enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' zen_draw_hidden_field('products_id'$listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CARTBUTTON_IN_CART_ALT) . '</form>';
                }
                } else {
    //just the Buy Now button, which goes to the cart but strangely shows a breadcrumb of the product info page, this is default action
                    
    if (!$is_slt_listing) {
                    
    $lc_button '<a href="' zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                    }
                    else {
    //Single Listing Template, removed the Manufacturers id in the link.
                    
    $lc_button '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'action=buy_now&products_id=' $listing->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT'class="listingBuyNowButton"') . '</a>';
                    }
                }
              }
            }
           
         
            break;
            case 
    'PRODUCT_LIST_QUANTITY':
            
    $lc_align 'right';
            
    $lc_text '<div class="itemQuantity">' $listing->fields['products_quantity'] . '</div>';
            break;
            case 
    'PRODUCT_LIST_WEIGHT':
            
    $lc_align 'right';
            
    $lc_text '<div class="itemWeight">' $listing->fields['products_weight'] . ' ' TEXT_PRODUCT_WEIGHT_UNIT '</div>';
            break;
            case 
    'PRODUCT_LIST_IMAGE':
            
    $lc_align 'center';
            if (
    $listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              
    $lc_text '';
            } else {
              if (isset(
    $_GET['manufacturers_id'])) {
                
    $lc_text '<div class="itemImage"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              } elseif (!
    $is_slt_listing) {//normal product listing
                
    $lc_text '<div class="itemImage"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              } else {
    //Single Listing Template
              
    $lc_text '<div class="itemImage"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              }
            }

            break;
          }

          
    $product_contents[] = $lc_text// Used For Column Layout (Grid Layout) Option

          
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') {
          
    $list_box_contents[$rows][$col] = array('align' => $lc_align,
                                                  
    'params' => 'class="main"',
                                                  
    'text'  => $lc_text);
        }
        }

        
    // add description and match alternating colors
        //if (PRODUCT_LIST_DESCRIPTION > 0) {
        //  $rows++;
        //  if ($extra_row == 1) {
        //    $list_box_description = "productListing-data-description-even";
        //    $extra_row=0;
        //  } else {
        //    $list_box_description = "productListing-data-description-odd";
        //    $extra_row=1;
        //  }
        //  $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
        //  'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION));
        //}

        // Following code will be executed only if Column Layout (Grid Layout) option is chosen
        
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
          
    $lc_text implode(''$product_contents);
          
    $list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' ' ' 'style="width:' $col_width '%;"',
                                                     
    'text'  => $lc_text);
          
    $column ++;
          if (
    $column >= $PRODUCT_LISTING_COLUMNS_PER_ROW) {
            
    $column 0;
            
    $rows ++;
          }
        }
        
    // End of Code fragment for Column Layout (Grid Layout) option in add on module
        
    if($is_slt_listing)
            
    $listing->MoveNextRandom();
        else
            
    $listing->MoveNext();
      }
      
    $error_categories false;
    } else {
      
    $list_box_contents = array();

      
    $list_box_contents[0] = array('params' => 'class="productListing-odd"');
      
    $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                                  
    'text' => TEXT_NO_PRODUCTS);

      
    $error_categories true;
    }

    if ((
    $how_many and $show_submit == true and $listing_split->number_of_rows 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == or  PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
      
    $show_top_submit_button true;
    } else {
      
    $show_top_submit_button false;
    }
    if ((
    $how_many and $show_submit == true and $listing_split->number_of_rows 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) {
      
    $show_bottom_submit_button true;
    } else {
      
    $show_bottom_submit_button false;
    }



      if (
    $how_many && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != and $show_submit == true and $listing_split->number_of_rows 0) {
      
    // bof: multiple products
        
    echo zen_draw_form('multiple_products_cart_quantity'zen_href_link(FILENAME_DEFAULTzen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post''enctype="multipart/form-data"');
      }

  7. #7
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Getting the price under the Product Title on category page

    remove one of the break;

    break;
    break;
    case 'PRODUCT_LIST_PRICE':

  8. #8
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Getting the price under the Product Title on category page

    Removed the extra break; and still getting a blank page

  9. #9
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Getting the price under the Product Title on category page

    I have this working here: http://zcadditions.com/zc10195/index...index&cPath=22

    the code provided is not the code from the single_listing_template mod: several things are missing included but not limited to

    break;
    case 'PRODUCT_LIST_NAME':
    $lc_text = TABLE_HEADING_PRODUCTS;
    $lc_align = '';
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_PRICE':
    $lc_text = TABLE_HEADING_PRICE;
    $lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
    $zc_col_count_description++;
    break;
    case 'PRODUCT_LIST_IMAGE':
    $lc_text = TABLE_HEADING_IMAGE;
    $lc_align = 'center';
    $zc_col_count_description++;

    without drilling into every line of your file, which I do not have the time todo. I suggest you "make note" of your changes and re-upload the original. You shouldn't have to remove any code, simply //commenting it out will work.

  10. #10
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Getting the price under the Product Title on category page

    no guarantee but I think I found what was causing the blank page:

    replace this:
    PHP Code:
                case 'PRODUCT_LIST_NAME':
            
    $lc_align '';
            
    $lc_text '<h3 class="itemTitle"><a href="' .  zen_href_link(zen_get_info_page($listing->fields['products_id']),  'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']  > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) :  ($_GET['cPath'] > ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))  . '&products_id=' $listing->fields['products_id']) . '">' .  $listing->fields['products_name'] . '</a></h3><div  class="listingDescription">' .  zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'],  $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .  '</div>';
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
              
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';  
              
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';  
                } else {
    //Single Listing Template
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</a></div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
                }
            } else {
    //not a manufacturer product listing, but the code loaded into $lc_text is the same in either case!! 
            
    if (!$is_slt_listing) {//normal product listing
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a>';
                } else {
    //Single Listing Template
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
                }
                }
           break;
    break;
             case 
    'PRODUCT_LIST_PRICE'
    with this:
    PHP Code:
    case 'PRODUCT_LIST_NAME':
    $lc_align '';
    $lc_text '<h3 class="itemTitle"><a href="' .  zen_href_link(zen_get_info_page($listing->fields['products_id']),  'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']  > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) :  ($_GET['cPath'] > ?  zen_get_generated_category_path_rev($_GET['cPath']) :  zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))  . '&products_id=' $listing->fields['products_id']) . '">' .  $listing->fields['products_name'] . '</a></h3><div  class="listingDescription">' .  zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'],  $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .  '</div>';
    } else {
    //Single Listing Template
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</a></div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';
                            }
            } else {
    //not a manufacturer product listing, but the code loaded into $lc_text is the same in either case!! 
            
    if (!$is_slt_listing) {//normal product listing
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a>';
                } else {
    //Single Listing Template
                
    $lc_text '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($listing->fields['master_categories_id']) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '<br />' '</div><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . MORE_INFO_TEXT '</a></div>';
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
    $lc_text .= '<a href="' .   zen_href_link(zen_get_info_page($listing->fields['products_id']),   'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id'])   > ?  zen_get_generated_category_path_rev($_GET['filter_id']) :   ($_GET['cPath'] > ?   zen_get_generated_category_path_rev($_GET['cPath']) :   zen_get_generated_category_path_rev($listing->fields['master_categories_id'])))   . '&products_id=' $listing->fields['products_id']) . '">' .   $lc_price '</a>';      
                            }
                }
    break;
             case 
    'PRODUCT_LIST_PRICE'

 

 

Similar Threads

  1. v151 Display Category Description below category Title on the Product page
    By Alexander81 in forum General Questions
    Replies: 11
    Last Post: 13 Apr 2013, 12:13 AM
  2. Display Category Description below category Title on the Product page
    By nigelt74 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 4 Sep 2009, 02:06 PM
  3. How do I add the same product in one category and also have it listed under AGE,Price
    By 24hourDomainer in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 28 Jul 2009, 08:27 AM
  4. Eliminating the Price display under the Product Name
    By Lacourse in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 28 Jun 2009, 11:25 AM
  5. Move currency dropdown box under product price on the product info page
    By opelben in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 11 May 2006, 06:31 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