Jump to content
Sign in to follow this  

Related Products V 3.2

Recommended Posts

I have Related Products V 3.2 installed and it works wonderfully. With one small problem. If you have more than say 5 items related to any one thing it stretches the page. I have been able to find the peice of code that controls this, with the help of i2Paq. Here is the code that needs to be changed


// DANIEL: begin - show related products
 $attributes = "select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from " . TABLE_PRODUCTS_OPTIONS_PRODUCTS . ", " . TABLE_PRODUCTS_DESCRIPTION . " pa, ". TABLE_PRODUCTS . " pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '" . (int)$languages_id . "' and pop_products_id_master = '".$HTTP_GET_VARS['products_id']."' and products_status=1 order by pop_order_id, pop_id";
 $attribute_query = tep_db_query($attributes);

 if (mysql_num_rows($attribute_query)>0) {

  echo '<tr><td><table class="productlisting" border="0" cellspacing="0" cellpadding="2" width="100%">';
  echo '<tr><td align="center" class="productListing-heading" > '.TEXT_RELATED_PRODUCTS.' </td></tr><tr><td align="center" class="productListing-data">';
  echo '<table border="0" cellspacing="0" cellpadding="2" width="100%" align="center"><Tr>';
while ($attributes_values = tep_db_fetch_array($attribute_query)) {
  $products_name_slave = ($attributes_values['products_name']);
  $products_id_slave = ($attributes_values['pop_products_id_slave']);
  if ($new_price = tep_get_products_special_price($products_id_slave)) {
	$products_price_slave = $currencies->display_price($new_price, tep_get_tax_rate($attributes_values['products_tax_class_id']));
  } else {
	$products_price_slave = $currencies->display_price($attributes_values['products_price'], tep_get_tax_rate($attributes_values['products_tax_class_id']));

// show thumb image if Enabled
echo '<td class="productListing-data" align="center">';
	echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">' . tep_image(DIR_WS_IMAGES . $attributes_values['products_image'], $attributes_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"').'</a>';
  echo '<Br> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id_slave) . '">'.$products_name_slave.'<Br>@ '.$products_price_slave.'</a>';
echo '</td>';	

echo '</tr></table></td></tr></table></td></tr>';
//DANIEL: end


in product_info.php.


What I need to be able to do is put in a line break after a set number of products, and I am nowhere near being proficient enough with programming to do that. i2Paq is looking into it for me, but I thought I would put it out there to see if anyone else might be able to take a look at it.


If you'd like to see an example of what I am talking about here is a link to a page on my site that is stretched.


Any help would be greatly appreicated. I would like to thank all the people that have added to this contribution and created this contribution it is wonderful.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this