Author Topic: how to disable sorting drop down menu in category view in VM3?  (Read 1037 times)

wiesiu

  • Beginner
  • *
  • Posts: 9
  • A beginner
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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7335
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.0.16
Re: how to disable sorting drop down menu in category view in VM3?
« Reply #1 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

wiesiu

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: how to disable sorting drop down menu in category view in VM3?
« Reply #2 on: March 04, 2015, 13:28:32 pm »
My code looks that:
What it Should be change ?

Code: [Select]
<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);
?>

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7335
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.0.16
Re: how to disable sorting drop down menu in category view in VM3?
« Reply #3 on: March 04, 2015, 13:41:19 pm »
there is no "dropdown sort" code in there
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

wiesiu

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: how to disable sorting drop down menu in category view in VM3?
« Reply #4 on: March 04, 2015, 13:52:39 pm »
in components\com_virtuemart\views\category\tmpl\default.php this only line code where i find
Code: [Select]
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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7335
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.0.16
Re: how to disable sorting drop down menu in category view in VM3?
« Reply #5 on: March 04, 2015, 21:43:27 pm »
yes - and u use that "test" to not show the sortby etc in the same file
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

likeuwill

  • Beginner
  • *
  • Posts: 1
  • A beginner
Re: how to disable sorting drop down menu in category view in VM3?
« Reply #6 on: April 10, 2017, 21:19:02 pm »
Answer for VirtueMart 3.2.1
Hiding sort menu when no products in categories
Code: [Select]
<?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 ?>