Hello!
How to remove sorting (drop down menu) in category view when this category is empty ? For answer thanks in advance.
VM 3.0.6.2
Joomla 3.4.0
Greetings
surround the code in
if (!empty($this->products)) {
}
over ride the template components\com_virtuemart\views\category\tmpl\default.php
My code looks that:
What it Should be change ?
<h1><?php echo $this->category->category_name; ?></h1>
<?php
if (!empty($this->products)) {
$products = array();
$products[0] = $this->products;
echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
?>
<div class="vm-pagination vm-pagination-bottom"><?php echo $this->vmPagination->getPagesLinks (); ?><span class="vm-page-counter"><?php echo $this->vmPagination->getPagesCounter (); ?></span></div>
<?php
} elseif (!empty($this->keyword)) {
echo vmText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword ? ' : (' . $this->keyword . ')' : '');
}
?>
</div>
<?php } ?>
</div>
<?php
$j = "Virtuemart.container = jQuery('.category-view');
Virtuemart.containerSelector = '.category-view';";
vmJsApi::addJScript('ajaxContent',$j);
?>
there is no "dropdown sort" code in there
in components\com_virtuemart\views\category\tmpl\default.php this only line code where i find if (!empty($this->products)) { ...
i don't know what should be change in this code to hide sorting menu for empty categorys ...for help big thanks
yes - and u use that "test" to not show the sortby etc in the same file
Answer for VirtueMart 3.2.1
Hiding sort menu when no products in categories
<?php
if (!empty($this->products)) {?>
<!-- Orderby + Pagination + Displaynumber -->
<div class="orderby-displaynumber">
<div class="floatleft vm-order-list">
<?php echo $this->orderByList['orderby']; ?>
<?php echo $this->orderByList['manufacturer']; ?>
</div>
<div class="floatright display-number">
<?php //echo $this->vmPagination->getResultsCounter ();?>
<?php echo JText::_('Показать'); ?> <div class="number"><?php echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>
</div>
<div class="clear"></div>
</div> <!-- End Orderby + Pagination + Displaynumber -->
<?php } ?>
simply :
display:none;
in your css class