Author Topic: How can i hide Headertext on Toplevel Category  (Read 20672 times)

sitebuildernow

  • Jr. Member
  • **
  • Posts: 66
    • Coburn Enterprises - "Better Everything"
Re: How can i hide Headertext on Toplevel Category
« Reply #15 on: April 08, 2009, 23:47:15 pm »
I don't know if you'll get this but I wanted to say thank you!!! Your mods made my day - I was really frustrated with the product list headers showing up on my main categories (when no products were listed under the top category). You rock!
Coburn Enterprises
"Better Everything"
Website Developer / SEO and SEM Expert
Joomla! and Virtuemart (current versions always)

bunak

  • Beginner
  • *
  • Posts: 37
Re: How can i hide Headertext on Toplevel Category
« Reply #16 on: August 08, 2010, 15:00:38 pm »
Hi all.

I propose a new modification of hack, that hide header text such as Name, Article, Price, Picture in selected categories with no products.

Edit 'browse_listtable.tpl.php' in '/www-root/components/com_virtuemart/themes/your-theme/templates/browse/includes/..'

Insert the red code in the beginning of the file:
Quote
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>
<?php echo $buttons_header // The PDF, Email and Print buttons ?>
<?php echo $browsepage_header // The heading, the category description ?>
<?php echo $parameter_form // The Parameter search form ?>
<?php
   // bunak - hide header table of products ----------------->>
   if (count($products) > 0) {
   // bunak - hide header table of products <<-----------------
?>

<?php echo $orderby_form // The sort-by, order-by form PLUS top page navigation ?>

... and in the end of the file.
Quote
...
// Display the table
echo $table->toHtml();
?>
<br class="clr" /><br />
<?php
   // bunak - hide header table of products ----------------->>
   }
   // bunak - hide header table of products <<-----------------
?>

<?php
// Show Featured Products
if( $this->get_cfg( 'showFeatured', 1 )) {
...

Where the variable $products is the VirtueMart's array of products.

Attach 'browse_listtable.tpl.php' that modified by this hack.

[attachment cleanup by admin]

rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503

bunak

  • Beginner
  • *
  • Posts: 37
Re: How can i hide Headertext on Toplevel Category
« Reply #18 on: August 08, 2010, 17:11:52 pm »
But the our method if compared with your - does no extra operators. It's important for optimization of work.