VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: wiesiu on March 04, 2015, 08:30:10 AM

Title: how to disable sorting drop down menu in category view in VM3?
Post by: wiesiu on March 04, 2015, 08:30:10 AM
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
Title: Re: how to disable sorting drop down menu in category view in VM3?
Post by: GJC Web Design on March 04, 2015, 12:04:05 PM
surround the code in

if (!empty($this->products)) {


}

over ride the template components\com_virtuemart\views\category\tmpl\default.php
Title: Re: how to disable sorting drop down menu in category view in VM3?
Post by: wiesiu on March 04, 2015, 13:28:32 PM
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);
?>
Title: Re: how to disable sorting drop down menu in category view in VM3?
Post by: GJC Web Design on March 04, 2015, 13:41:19 PM
there is no "dropdown sort" code in there
Title: Re: how to disable sorting drop down menu in category view in VM3?
Post by: wiesiu on March 04, 2015, 13:52:39 PM
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
Title: Re: how to disable sorting drop down menu in category view in VM3?
Post by: GJC Web Design on March 04, 2015, 21:43:27 PM
yes - and u use that "test" to not show the sortby etc in the same file
Title: Re: how to disable sorting drop down menu in category view in VM3?
Post by: likeuwill on April 10, 2017, 21:19:02 PM
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 ?>
Title: Re: how to disable sorting drop down menu in category view in VM3?
Post by: melix on August 07, 2017, 01:42:21 AM
simply :
display:none;
in your css class