Author Topic: Fixed width in list products (browse_notables.tpl.php)  (Read 2832 times)

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Los Angeles immigration lawyers
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Fixed width in list products (browse_notables.tpl.php)
« on: April 19, 2011, 03:32:02 am »
Hello



As you can see in the image the width changes depending on the short description of the product. I have searched the forum, and the file that is affecting is browse_notables.tpl.php, I read somewhere that the line that manages the columns width here is:

Code: [Select]
echo "<div style=\"margin-right: 5px; width:". intval(round(100/$cell_count)-2) ."%; float:left;\" id=\"".uniqid( "row_" ) ."\">";

However I can't get it to work on this template, I don't have much kwnoledge of PHP and don't know where I should add it. I changed the mynxx browse_notables.tpl.php for the default one and the columns width is fine, but the style of my template is changed obviously. Could someone help me to solve this, what line must I add or change to have 2 columns with equal width as on the default template?

browse_notables.tpl.php code:

Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__); ?>


<?php echo $buttons_header // The PDF, Email and Print buttons ?>
<div class="details-catbar">
<span class="catbar-text">
<?php echo $browsepage_header // The heading, the category description ?>
</span>
</div>
<?php echo $parameter_form // The Parameter search form ?>
<div class="orderby-bar">
<div class="orderby-bar-padding">
<div class="orderby-box">
<?php echo $orderby_form // The sort-by, order-by form PLUS top page navigation ?>
</div>
</div>
</div>
<div id="product_list">
<?php
$data =array(); // Holds the rows of products
$i 1$row 0// Counters
foreach( $products as $product ) {

foreach( $product as $attr => $val ) {
// Using this we make all the variables available in the template
// translated example: $this->set( 'product_name', $product_name );
$this->set$attr$val );
}

// Parse the product template (usually 'browse_x') for each product
// and store it in our $data array 
$data[$row][] = $this->fetch_cache'browse/'.$templatefile .'.php' );

// Start a new row ?
if ( ($i $products_per_row) == 0) {
$row++;
}
$i++;

}
// Creates a new HTML_Table object that will help us
// to build a table holding all the products
$table =& new HTML_Table('width="100%" cellpadding="0"');

// Loop through each row and build the table
foreach($data as $key => $value ) {
$table->addRow($data[$key] );
}
// Display the table
echo $table->toHtml();
?>

</div>
<?php 
echo $browsepage_footer;

//Re-enable this block if you wish to add the featured products and recent products block to the bottom of the page.
//------------------------------------------------------
// Show Featured Products
//if( $this->get_cfg( 'showFeatured', 1 )) {
    /* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
    edit featuredproduct.tpl.php to edit layout */
//    echo $ps_product->featuredProducts(true,10,true);
//}
//echo $recent_products;
//-------------------------------------------------------
?>

Using VM 1.1.8 and joomla 1.5.22

Thanks

aravot

  • Peter
  • Quality&Testing Team
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: Fixed width in list products (browse_notables.tpl.php)
« Reply #1 on: April 19, 2011, 04:09:06 am »
I think I saw a solution for this in Rockettheme forum, not a member anymore but if you are you could check their forum.

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Los Angeles immigration lawyers
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Fixed width in list products (browse_notables.tpl.php)
« Reply #2 on: April 19, 2011, 13:00:38 pm »
Solution:

components/com_virtuemart/themes/vm_mynxx/theme.css

change from:

Code: [Select]
#product_list td {border: 1px solid #ccc;background: #f9f9f9;}
to:

Code: [Select]
#product_list td {vertical-align: top;width: 50%;border: 1px solid #ccc;background: #f9f9f9;}
Thanks a lot, solved.

chintan

  • Beginner
  • *
  • Posts: 6
Re: Fixed width in list products (browse_notables.tpl.php)
« Reply #3 on: April 21, 2011, 15:31:03 pm »
Thanks dear..

It also solved my problem...
This problem appeared after upgrading to new mynxx 1.5.7 template.
I was searching for this problem since few days...and here you came to save me !!!

Though, I am having a small issue with virtuemart shop front page.
Why my shop front page theme is not consistent with category theme?
I am not getting borders around the random product boxes...any clue on this?

you can see the problem on my site
www.beyondtoyz.in


Regards,
Chintan