News:

Looking for documentation? Take a look on our wiki

Main Menu

How to hide pagination in category view in VM3?

Started by Tiger78, November 08, 2015, 13:10:35 PM

Previous topic - Next topic

Tiger78

Hello,

I want to hide the pagination or parts of the pagination in category view if the "total size of products" (in 1 category, not in 1 page) is lower than the limit (limit box).

For example:



<?php 
  
if ($this->total) > ($this->limit)   { ?>

<div class="orderby-displaynumber">
    <div class="vm-pagination"><?php echo $this->vmPagination->getPagesLinks(); ?></div>
            <div class="vm-page-counter"><?php echo $this->vmPagination->getPagesCounter (); ?></div>
            <div class="display-number"><?php echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>
</div>
      <?php
      

      
?>




But the values of $this->total and $this->limit (vmpagination.php) are always 0 in category view.

For $this->total I´ve also tried count($products).

What are the correct terms?

Thanks!

GJC Web Design

count($this->products)

and echo out $this->category to see what the limit vars are
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

Tiger78

#2
1. count($this->products) is the number of products on the respective side,
e.g.
20 products on category page 1
20 products on category page 2
3 products on category page 3

But what is the overall number of products in the category? (in this example: 43)

2. echo $this->category; displays the following: TableCategories

How can I see the limit vars?


GJC Web Design

but if you want to show pagi only if > page limit then count will work

Quoteecho $this->category; displays the following: TableCategories

impossible  ..

you have at least  $this->category->limit_list_step

use

print 'Debug Line '.__LINE__.' $this->category <pre>'; print_r ($this->category); print "</pre><br />\n";

same for   $this->vmPagination  ..  might be something there

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

Tiger78

#4
Ah...thanks....that´s it! The correct code (if) is:

<?php 
  
if ($this->vmPagination->total  >  $this->vmPagination->limit)   { ?>

<div class="orderby-displaynumber">
    <div class="vm-pagination"><?php echo $this->vmPagination->getPagesLinks(); ?></div>
            <div class="vm-page-counter"><?php echo $this->vmPagination->getPagesCounter (); ?></div>
            <div class="display-number"><?php echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>
</div>
      <?php
      

      
?>



Now parts of pagination will be displayed only if it is nessesary. This is advantageous in my template design.