VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: philows on December 07, 2011, 09:22:10 AM

Title: Pagination problems in category view - 1.9.8.RC2M
Post by: philows on December 07, 2011, 09:22:10 AM
If i look at a category list with several pages and go to page 3 and afterwards go to an other category with only 1 page of products, no products is showing.

If i then go back to the category with sereval pages, go to page 1, and then go back to the category with only 1 page, the products will be displayed again.

I guess the pagination is not reset each time a new category is chosen.

Michael
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: Milbo on December 07, 2011, 12:20:53 PM
I assume you have that problem in j1.7. Ah yes. It is fixed in j1.5, but not j17
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: Awerso on December 08, 2011, 20:36:15 PM
i use j1.7 and reported this problem multiple times now, when will it be fixed? this is a major bug in my opinion...
(i dont use rc3 so maybe its already fixed)
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: jjk on December 08, 2011, 20:42:43 PM
It's an old bug that had been fixed already, but for some reason reappeard recently.
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: euroboss on December 12, 2011, 20:46:34 PM
Hi guys, I've got the similar problem with pagination cant get to the next page, pls help J1.5 VM2

look this:
http://kopiarki.pl/index.php/2011-12-10-10-54-03/page/0/atramenty-do-ploterow.html

Ive been looking whole day for a solution but failed... :(


J1.5 VM2
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: Milbo on December 13, 2011, 11:38:39 AM
I dont see any Pagination... when you changed your layout, you should know that we have vmPagination and not pagination any longer.
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: denyal on December 13, 2011, 20:32:58 PM
/administrator/components/com_virtuemart/helpers/vmmodel.php

add in line 305
if(!$_GET['start']) $limitStart=0;

just after
if(!empty($limit)){
         $limitStart = ceil((float)$limitStart/(float)$limit) * $limit;
      }
if(!$_GET['start']) $limitStart=0;

a quick fix, thanks to my teacher Fotis  :)

it works for me so far
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: Milbo on December 13, 2011, 20:43:59 PM
you must add/replace at line 390

if($this->_withCount){

$this->_db->setQuery('SELECT FOUND_ROWS()');
$count = $this->_db->loadResult();

if($count == false){
$count = 0;
}
$this->_total = $count;
if($limitStart>$count){
$limitStart = floor($count/$limit);
$this->_db->setQuery($q,$limitStart,$limit);
if($object == 2){
$this->ids = $this->_db->loadResultArray();
} else if($object == 1 ){
$this->ids = $this->_db->loadAssocList();
} else {
$this->ids = $this->_db->loadObjectList();
}
}
$this->getPagination($count,$limitStart,$limit);


only then you get the real fix. The problem is the optimization with SELECT SQL_CALC_FOUND_ROWS, so we know after we got the ids that there is no page 5. So we must redo the query for this case.


and the function at line 305 is also changed to       


if(version_compare(JVERSION,'1.6.0','ge')) {
$limitStart = $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limitstart', 'limitstart',  0, 'int');
} else {
$limitStart = JRequest::getInt('limitstart',0);
}

and this must be done before the line $limitStart = ceil((float)$limitStart/(float)$limit) * $limit; This ensures what you did above, just using the right filters for it (clean and safe).

This fix is since more than a week in the svn, btw (and of course in the last 5 subreleases)
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: denyal on December 13, 2011, 20:55:29 PM
Great! Thanks Milbo!

I'll go make the changes!

I haven't upgraded since 2.0.0-RC-2M because the site is already online and I'm waiting for the final-stable release.
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: PRO on December 13, 2011, 21:29:33 PM
Quote from: denyal on December 13, 2011, 20:55:29 PM
the site is already online and I'm waiting for the final-stable release.

You should setup a local xampp etc, or have a separate/private domain  with current version. Some things do change, and you do not want to upgrade on a live site.

If you have to, you can do a seperate install in a folder (protected by password)

Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: Milbo on December 14, 2011, 00:13:01 AM
The update is working quite correct except for the plugins. When you get problems there write to me to help with this.
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: T.A. Garrison, LLC on January 13, 2012, 00:54:23 AM
I disagree with the pagination issue. http://mailersusa.com/jupgrade/index.php/component/virtuemart/view/category/virtuemart_category_id/4

As you can see, this is in a jupgrade situation with 1.7 and the latest vm 2.0 - that, according to the admin "Virtuemart 2 - Live Update".

I've also checked vmodel.php for both lines 305 and 390 (slightly off in my file) and found that my code matches what is found above here.
When you click on the additional pages, nothing happens - even the url has only the hash mark added, which, to my knowledge, is not supposed to happen.

Did I miss something? Will this issue be resolved simply by my adding stock to the products?
An element inspection (using Chrome) shows that just before the final id is "start" - /virtuemart_category_id/4/start/10. Shouldn't that be "/virtuemart_category_id/4/next/10"?

I'm anxious to get a resolve, although I "could" just hide the pagination.
Thanks.
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: design609 on January 24, 2012, 16:18:11 PM
Is the issue of pagination resolved?

I am on a J1.5.25
VM 2.0 stable

When I have more than 10 products in a subcategory I only see thes 10 products - with a pagination below where the number 1 2 3 is show. None of these are workable links (point at same page (SEF turn on))

If I change display of number of product from the category settings in admin I still only get my 10 product (not 24 as I have).
I tried setting in VM configuration, all top categories and subcategories - nothing happens. Still only my first 10 products is viewable.

Guess others have problems too:
http://forum.virtuemart.net/index.php?topic=95175.msg312348#msg312348
http://forum.virtuemart.net/index.php?topic=95401.msg313157#msg313157

Hope someone can confirm issue real or not?

Cheers
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: design609 on January 24, 2012, 17:09:58 PM
Hi
Tested with Native Joomla SEF = off
Now I can navigate between pages, but still no control over how many product to show above 10.

Is it for real that pagination not work with J1.5.25 and Virtuemart 2 stable?
Cheers


EDIT:::::::::::::::::::

Emptied cache in browser
Cleaned cache in Joomla admin TOOLS-Clean cache - VM

Now the link with pagination
/page/0/strik/
/page/1/strik/

EDIT 2:::::::::::::::::::

Sorted the issue of shown products by going in the VM config again
/administrator/index.php?option=com_virtuemart&view=config
This time looking the right place "Shopfront" instead of Templates -> Shopfront

My bad....
Title: Re: Pagination problems in category view - 1.9.8.RC2M
Post by: enock on March 02, 2012, 07:06:40 AM
J2.5.1 VM 2.0.2

Pagination problems still exist when you switch between Categories (if you leave a category on Page 6) you end up on page 6 in the next category.

Why can't we set the page counter to 1 when you click on a category?