VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: mrmagoo on March 01, 2012, 09:39:37 AM

Title: When I change category, VM don't reset the page number
Post by: mrmagoo on March 01, 2012, 09:39:37 AM
I have 3 pages for category A and 5 pages for category B.
For example, browsing through the pages of category A I stop at page 2.
Then I decide to select the category B.
Unfortunately it happens that navigation in category B starts from page 2 instead of page 1.
So for all the categories

Thanks
Bye
Title: Re: When I change category, VM don't reset the page number
Post by: enock on March 02, 2012, 03:49:58 AM
I put up a post http://forum.virtuemart.net/index.php?topic=98113.msg323512#msg323512

agree - it is crazy you are on page 6 in one category and change category and you are taken to page 6 not page 1
Title: Re: When I change category, VM don't reset the page number
Post by: mrmagoo on March 02, 2012, 15:49:50 PM
At this topic  http://forum.virtuemart.net/index.php?topic=94540.0 (http://forum.virtuemart.net/index.php?topic=94540.0)  Reply #6 (denyal)  I found the solution of my problem.
Unfortunately now I can't change page in the back-end of products.
:(   :(   :(  ....  >:(

Title: Re: When I change category, VM don't reset the page number
Post by: mrmagoo on March 02, 2012, 16:18:27 PM
I moved the string given by "denyal" in IF statement of JVM_VERSION as you can see in the code, adding an IF statement to check the contents of $view.

if(JVM_VERSION === 2) {
$limitStart = $mainframe->getUserStateFromRequest('com_virtuemart.'.$view.'.limitstart', 'limitstart',  0, 'int');
if ($view == "category") {
if(!$_GET['start']) $limitStart=0;
}
} else {
$limitStart = JRequest::getInt('limitstart',0);
}



Now the pagination of the products starts from 0 when I change the category and the back-end of the products works.
Title: Re: When I change category, VM don't reset the page number
Post by: mrmagoo on March 02, 2012, 16:35:13 PM
 >:( >:( >:(
Now doesn't work pagination in the back-end of the categories.

HELP ME!  :'(

There is a way to check if I am in the front-end rather than the back-end?

Thanks.
Title: Re: When I change category, VM don't reset the page number
Post by: enock on March 11, 2012, 06:06:07 AM
Thanks for trying mrmagoo but with this code in place you can't leave page one  :(
Title: Re: When I change category, VM don't reset the page number
Post by: PRO on March 11, 2012, 11:49:17 AM
what version are you using? as far as I know pagination is solved
Title: Re: When I change category, VM don't reset the page number
Post by: enock on March 11, 2012, 22:22:32 PM
J2.5.2 VM2.0.3B

See for yourself - test site http://www.loti.com.au (it's a bit slow -has 4500 products - is that due to VM?)

Click on Street Magic Category - then click on page 5 now click on category Books - you go directly to page 5.

No - it isn't fixed yet

As of March 8  Milbo http://forum.virtuemart.net/index.php?topic=99258.0looks like there will be a fix to my problem by Milbo http://forum.virtuemart.net/index.php?topic=99258.0 still thinks it's a problem
Title: Re: When I change category, VM don't reset the page number
Post by: Milbo on March 12, 2012, 10:52:47 AM
I am quite sure this is fixed in the svn now.
Title: Re: When I change category, VM don't reset the page number
Post by: enock on March 13, 2012, 03:32:51 AM
It's not in VM2.0.3B - so will see it in 2.0.3C?
Title: Re: When I change category, VM don't reset the page number
Post by: enock on March 22, 2012, 05:54:23 AM
J 2.5.2 VM 2.0.3E Still not working

Here are other peoples mentions
http://forum.virtuemart.net/index.php?topic=96301.msg326327#msg326327

http://forum.virtuemart.net/index.php?topic=99590.msg329786#msg329786

http://forum.virtuemart.net/index.php?topic=98876.msg326623#msg326623

http://forum.virtuemart.net/index.php?topic=98113.msg323512#msg323512
Title: Re: When I change category, VM don't reset the page number
Post by: mrmagoo on March 26, 2012, 23:00:09 PM
Quote from: Milbo on March 12, 2012, 10:52:47 AM
I am quite sure this is fixed in the svn now.


I'm sorry, but it's not fixed for me ( J 2.5.3 + VM 2.0.2).
I have temporarily solved the problem by adding the last three lines of code after line 362


//There is a strange error in the frontend giving back 9 instead of 10, or 24 instead of 25
//This functions assures that the steps of limitstart fit with the limit
if(!empty($limit)){
     $limitStart = ceil((float)$limitStart/(float)$limit) * $limit;
}




new code to be added

if (!stristr($_SERVER['REQUEST_URI'], 'administrator')) {
if(!$_GET['start']) $limitStart=0;
}



It isn't a "wonderful" change, but now it works and pagination starts from 1 when I select a new category in front-end, leaving the way to page the back end.
Title: Re: When I change category, VM don't reset the page number
Post by: VlaKur on May 16, 2012, 10:53:32 AM
I add
      if (!stristr($_SERVER['REQUEST_URI'], 'administrator')) {
         if(!$_GET['start']  and strpos($_SERVER['REQUEST_URI'], "results") == false  ) $limitStart=0;
      }

that when change sort orders, it work too...
Title: Re: When I change category, VM don't reset the page number
Post by: pnguyen on May 29, 2012, 08:22:00 AM
Thank Vlakur

But in VM2.x , I modify you code line : "if(!$_GET['start']"  to "if(!$_GET['limitstart']"

full code:
if (!stristr($_SERVER['REQUEST_URI'], 'administrator')) {
            if(!$_GET['limitstart']  and strpos($_SERVER['REQUEST_URI'], "results") == false  ) $limitStart=0;
        }
Title: Re: When I change category, VM don't reset the page number
Post by: joophilverink on July 12, 2012, 12:13:39 PM
Quote from: mrmagoo on March 26, 2012, 23:00:09 PM
Quote from: Milbo on March 12, 2012, 10:52:47 AM
I am quite sure this is fixed in the svn now.


I'm sorry, but it's not fixed for me ( J 2.5.3 + VM 2.0.2).
I have temporarily solved the problem by adding the last three lines of code after line 362


//There is a strange error in the frontend giving back 9 instead of 10, or 24 instead of 25
//This functions assures that the steps of limitstart fit with the limit
if(!empty($limit)){
     $limitStart = ceil((float)$limitStart/(float)$limit) * $limit;
}




new code to be added

if (!stristr($_SERVER['REQUEST_URI'], 'administrator')) {
if(!$_GET['start']) $limitStart=0;
}



It isn't a "wonderful" change, but now it works and pagination starts from 1 when I select a new category in front-end, leaving the way to page the back end.

Hi,
I do have the same problem. Where can I find this php file??