Forums / Templates, Stylesheets, Page Layout / Making each product listing on the Category pages a link

Making each product listing on the Category pages a link

Views: 3,020

Results 1 to 20 of 21
6 Mar 2013, 5:58 AM
#1
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Making each product listing on the Category pages a link

Hello fellow Zen Cart users i'm having a bit of a problem make each product row clickable to the product info page. My category page is http://qualityautowi.com//index.php?main_page=index&cPath=8. What I want to accomplish is when you hover over each product row you can click anywhere within that box and it will take you to the product info page. The file that controls the information on that page is below. Any help would be greatly appreciated. Thank you

<?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_listing, false);//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 == 0 ) {
      $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'] > 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']) . '">' . $listing->fields['products_name'] . 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'] . '</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>';
			}
		} 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'] > 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']) . '">' . $listing->fields['products_name'] . 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'] . '</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>';
			}
			}
        break;
        case 'PRODUCT_LIST_MANUFACTURER':
        $lc_align = '';
        $lc_text = '<div class="itemManufacturer"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div>';
        break;
        case 'PRODUCT_LIST_PRICE':
        $lc_price = '<div class="itemPrice">'.zen_get_products_display_price($listing->fields['products_id']) . '</div>';
        $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'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_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'] != 0 &&
                // 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'] > 0 || 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_NOW, BUTTON_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_button= zen_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_CART, BUTTON_IN_CART_ALT) . '</form>';
            } else {//Single Listing Template
			$lc_button= zen_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_CART, BUTTON_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_NOW, BUTTON_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_NOW, BUTTON_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'] > 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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_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'] > 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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_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_WIDTH, IMAGE_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 > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or  PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
  $show_top_submit_button = true;
} else {
  $show_top_submit_button = false;
}
if (($how_many > 0 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 > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 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_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');
  }
11 Mar 2013, 3:00 PM
#2
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

To make this a little bit clear I have found an example of what I would like to accomplish. I would like to create a block hover effect for the list of product rows. Here is a link to the example of what it should look like. http://www.smileycat.com/miaow/archives/link-list-block-hover.php I have tried messing with the code above and I'm getting nowhere. I'm sure this would be easy to implement. Also I'm using Single Listing Template add on. I'm hoping someone can guide me in the right direction. Thanks

11 Mar 2013, 3:12 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Making each product listing on the Category pages a link

You can't make a table row into a link. However, the elements inside each table cell are already links to the same place, so what you need to do is expand the area of those links to fill the cells. This will involve eliminating padding in the cells and margins on the links, and making the link dimensions fill the cells... all stylesheet work.

You can add a hover effect to the table rows, though, so the whole row changes background color or something on hovering. Again, this is stylesheet work.

11 Mar 2013, 3:16 PM
#4
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

I understand what you are saying. So how do you expand each link to fill the cell. Do you accomplish this using css or do I have to change this within the code.

11 Mar 2013, 3:19 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Making each product listing on the Category pages a link

As I said, it is stylesheet work. The right CSS rules can do it. I'm leaving now, but I can look at it later if you still need help.

11 Mar 2013, 3:23 PM
#6
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

Thanks for your help I will find out what style's make this happen.

12 Mar 2013, 9:00 PM
#7
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

I have tried and tried to figure this out and having a bit of a problem. I have researched how to increase the click-able area of text and found that if I add the css below it will accomplish what I need. This is just an example...if you increase to the padding up or down the area will increase. So far I'm able to make everything to the right and left of the image and the description click-able, but having a problem getting the top and bottom click-able. I need a little assistance please.

display:block;
padding:20px 20px 20px 20px;

I have created a separate stylesheet for the sold category. http://qualityautowi.com/index.php?main_page=index&cPath=8. This is the page I'm currently working on.

12 Mar 2013, 10:08 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Making each product listing on the Category pages a link

You have to set margins and padding for all of the elements in the row to 0, and you might need to add !important to some of the property values if they are set otherwise inline. I was playing with it and found these rules to cover much of the requirements, but don't have more time right now.

.list_box, .list_box>.main {padding: 0; margin: 0;}
.list_box>.main>.itemImage {margin: 0; padding: 0; height: auto; width: auto;}
.list_box>.main>.itemImage>a {display: block; width: 300px; height: 200px;}
.list_box>.main>a {display: block; width: 375px; height: 200px; margin: 0;}

Some parts of this might not be necessary. Find the existing rules that apply to some of these elements and modify or replace them instead of just adding new rules.

13 Mar 2013, 3:16 PM
#9
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

Thanks for your help gjh42. I have tweaked your css to fit my needs, but I'm having a bit of a problem. What I'm trying to accomplish is when you hover anywhere within that box the text will turn white. I'm not quite sure if that is possible,but would really like to make it work like that. Any ideas on how I can do this.

13 Mar 2013, 3:38 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Making each product listing on the Category pages a link

You will need probably several specific selectors, since links and possibly other elements will have colors already set which will not be affected by the container color. Something like

.list_box:hover>.main>.itemImage>a, .list_box:hover>.main>a {color: #ffffff;}

13 Mar 2013, 8:14 PM
#11
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Making each product listing on the Category pages a link

.list_box:hover a {
color:#ffffff;
}

should work also

14 Mar 2013, 12:43 AM
#12
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

Thanks again for your help. I guess there is a couple more problem's...on my all products page I have the price listed in each box, but it's not a link. How do I make the product price a link. Here is the code for the product_listing.php page. The code before was not the single listing template code. Also How do I get the product title to be on it's own line.

<?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_listing, false);//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 == 0 ) {
      $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'] > 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']) . '">' . $listing->fields['products_name'] . 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'] . '</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'] > 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']) . '">' . $listing->fields['products_name'] . 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'] . '</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_MANUFACTURER':
        $lc_align = '';
        $lc_text = '<div class="itemManufacturer"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div>';
        break;
        case 'PRODUCT_LIST_PRICE':
        $lc_price = '<div class="itemPrice">'.zen_get_products_display_price($listing->fields['products_id']) . '</div>';
        $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'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_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'] != 0 &&
                // 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'] > 0 || 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_NOW, BUTTON_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_button= zen_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_CART, BUTTON_IN_CART_ALT) . '</form>';
            } else {//Single Listing Template
			$lc_button= zen_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_CART, BUTTON_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_NOW, BUTTON_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_NOW, BUTTON_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'] > 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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_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'] > 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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_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_WIDTH, IMAGE_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 > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or  PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
  $show_top_submit_button = true;
} else {
  $show_top_submit_button = false;
}
if (($how_many > 0 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 > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 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_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');
  }
14 Mar 2013, 2:15 AM
#13
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Making each product listing on the Category pages a link

you could add a link to the price by wrapping $lc_price

like so
'<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>';

you could insert a <br /> after the products name $listing->fields['products_name']

like so
$listing
->fields['products_name'] . '<br />' .

14 Mar 2013, 10:37 PM
#14
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

Thanks again for your response. I got the </br> after the product title, but Still having problem getting the link to work. When I wrap your code around the $lc_price it doesn't show anything , but a blank space next to product description. Not sure if that is a problem on my end or not. Any more help would be greatly appreciated.

14 Mar 2013, 11:16 PM
#15
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Making each product listing on the Category pages a link

i'm not reproducing that error.

this is the code I have exactly:

        

$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>';
14 Mar 2013, 11:30 PM
#16
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

The code I just added on the product_listing file As you can see on my http://qualityautowi.com/index.php?main_page=products_all page i'm getting no price.

<?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_listing, false);//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 == 0 ) {
      $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'] > 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']) . '">' . $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'] > 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']) . '">' . $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'] > 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>';  
        $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'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_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'] != 0 &&
                // 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'] > 0 || 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_NOW, BUTTON_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_button= zen_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_CART, BUTTON_IN_CART_ALT) . '</form>';
            } else {//Single Listing Template
			$lc_button= zen_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_CART, BUTTON_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_NOW, BUTTON_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_NOW, BUTTON_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'] > 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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_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'] > 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']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_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_WIDTH, IMAGE_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 > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or  PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
  $show_top_submit_button = true;
} else {
  $show_top_submit_button = false;
}
if (($how_many > 0 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 > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 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_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');
  }
14 Mar 2013, 11:58 PM
#17
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Making each product listing on the Category pages a link

looks like you replaced $lc_price instead of $lc_text or with $lc_text

    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>';
15 Mar 2013, 12:25 AM
#18
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

Ok now with that code above i'm getting an extra product title and product description, but the price is click-able. Getting closer.

15 Mar 2013, 8:49 AM
#19
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Making each product listing on the Category pages a link

yeah my fault, stupid me. copied from custom template. all you need to do is remove the .period

change this
$lc_text .=

to
$lc_text =

15 Mar 2013, 4:46 PM
#20
godfatherantiques avatar

godfatherantiques

Zen Follower

Join Date:
Nov 2010
Posts:
101
Plugin Contributions:
0

Re: Making each product listing on the Category pages a link

Thank you for your quick response...I did get it to work, but I think it's bit to squished. I hate to ask, but I think it would look a lot better under the product title. Any assistance on how to complete that would be appreciated. Thanks again for your help.