Home » Zen-cart

How to fix row height in zen-cart product listing?

27 July 2008 1,200 views Popularity: 3% Share/Bookmark

email

Almost one year back, I had problem with the product display in Zen-cart. I searched for help in zen-cart forum. I started a topic over there. But at last, I myself had to post the solution on that thread.. coz, I found the solution. ;) I just wanted to include that problem and solution in this post.

My problem was:-

I have ‘new products’ listing in my index page of zen-cart. I have used column grid layout. My layout is 3 columns per row. I have made the height of product image to be fixed to 80px. I also don’t have any problem with the width of the product as it is same for all the products.

But, still i have problem in product display. I have long names for some of the products. The products with long name are taking more space, hence pushing the other products below and making the display improper.

I think if I could make a constant height for each row, then the problem will be solved. But, I don’t have any idea, how to do so…

Any help???

Please note that I have used Zen-cart module called “Column Layout Grid for Product Listing”.

And my solution for this problem is:-

At first, you need to add in your includes/templates/YOUR_TEMPLATE/css/stylesheet.css file…

.clearBoth{
clear: both;
}

Then, you need to edit in your includes/templates/YOUR_TEMPLATE/common/tpl_columnar_display.php file…

Add this code:-


if($col == (sizeof($list_box_contents[$row]) - 1))
{
echo "<br class=\"clearBoth\" />";
}

The above code should be written below this one:-


echo '<div' . $r_params . '>' . $list_box_contents[$row][$col]['text'] .  '</div>' . "\n";

Try it. Implement it. Enjoy Zen-cart… Walking in Zen.. Sitting in Zen.. :D

Related posts:

  1. Displaying all products and new products listing in column/grid layout – Zen-cart
  2. Magento: Get order option of configurable and bundle product in cart
  3. Magento: Get all shopping cart items and totals
  4. Magento 1.4: No products displayed in category listing
  5. Magento: Get width height of image using Varien_Image class
  6. Magento: How to get all associated children product of a configurable product?
  7. Magento: Create Shopping Cart Price Rule Programmatically
  8. Magento: Get parent id of simple product associated to configurable product
  9. Magento: Downloadable products not displayed in Associated Products tab in Grouped Product
  10. jQuery: Grey out background and preview image as popup