News:

Looking for documentation? Take a look on our wiki

Main Menu

how to disable sorting drop down menu in category view in VM3?

Started by wiesiu, March 04, 2015, 08:30:10 AM

Previous topic - Next topic

wiesiu

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

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

wiesiu

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);
?>

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

wiesiu

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

GJC Web Design

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

likeuwill

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 ?>

melix