VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: tonis on November 20, 2012, 18:22:54 PM

Title: [ SOLVED ] Pagination on manufacturer browse page - number of products
Post by: tonis on November 20, 2012, 18:22:54 PM
Hello

In configuration I have set "number of max displayed product on one page" to 15. In category browse page it works fine, there are 15 products displayed on one page (for every page in the pagination).

But, on manufacturer browse page, there are only 9 product for one page ... and I would be happy if the number of displayed products was from the default setting. Knows someone where to change the number 9 do 15?


The pagination works fine, SEO is on in Joomla and also in VM.
Joomla 2.5.8, VM 2.0.14
Title: Re: Pagination on manufacturer browse page - number of products
Post by: chetanmadaan on November 22, 2012, 19:08:57 PM
tonis -

There isn't a permanent solution i found for this... but i did found something for you to display 15 products per page... allthough the pagenavigation would still say displaying 1-9 of X and will be duplicating the products on the second page... but i am just posting the solution so someone else can digg in the rest for me/you.
Step 1
so, go to file.
administrator/components/com_virtuemart/helpers/vmmodel.php
look for function named exeSortSearchListQuery would be around like 326...  and add a this code right next to it...
$limit = 15;

so, the new code would look something like this.

public function exeSortSearchListQuery($object, $select, $joinedTables, $whereString = '', $groupBy = '', $orderBy = '', $filter_order_Dir = '', $nbrReturnProducts = false){
$limit = 15;


now, this will display 15 products per page for manufacturers... i didn't test if it breaks/overrides the number of products being displayed on the category layout.
Step 2
Now, you would still see on the top right of the page. displaying 1 - 9 of X to remove that... you go to the following file.
components/com_virtuemart/views/category/tmpl/default.php
line number: 180.. look for the following code

<div class="width30 floatright display-number"><?php echo $this->vmPagination->getResultsCounter ();?><br/><?php echo $this->vmPagination->getLimitBox (); ?></div>
and change with

<div class="width30 floatright display-number"><?php //echo $this->vmPagination->getResultsCounter ();?><br/><?php echo $this->vmPagination->getLimitBox (); ?></div>

this will hide the "display 1 - 9 of X"

Step 3
Change the drop down of number of results per page.

Go to the virutemart configuration in the backend and go to the template tab and change the "Set the pagination sequence for the List Box" to "15,30,45,60" as displayed in the image below.

(http://content.screencast.com/users/jmexperts/folders/Jing/media/0373b5e6-8235-4ff6-9b28-c5ff3dfb33a2/virtuemart%20Settings.png)

This will get you going.


Title: Re: Pagination on manufacturer browse page - number of products
Post by: tonis on November 23, 2012, 00:05:04 AM
Hello

Thanks for your post chetanmadaan

It gives exactly the problems you mentioned ... so, i need to search more.


But i have found some interesting in the first file where you set the limit. A little bit higher in function setPaginationLimits() is a short comment ... "//There is a strange error in the frontend giving back 9 instead of 10, or 24 instead of 25" ... i think this could be the cause of me problem too, or it have some connection with it.
Title: Re: Pagination on manufacturer browse page - number of products
Post by: tonis on November 26, 2012, 12:36:08 PM
OK, i have found a solution in some other post...

http://forum.virtuemart.net/index.php?topic=104709.msg364194#msg364194

For me, now it gives the same pagination for category product page, and for manufacturer product page...
Title: Re: Pagination on manufacturer browse page - number of products
Post by: chetanmadaan on November 26, 2012, 17:38:50 PM
Great to hear that.