Author Topic: When I change category, VM don't reset the page number  (Read 4830 times)

mrmagoo

  • Beginner
  • *
  • Posts: 14
When I change category, VM don't reset the page number
« 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

enock

  • Beginner
  • *
  • Posts: 40
Re: When I change category, VM don't reset the page number
« Reply #1 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

mrmagoo

  • Beginner
  • *
  • Posts: 14
Re: When I change category, VM don't reset the page number
« Reply #2 on: March 02, 2012, 15:49:50 pm »
At this topic  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.
 :(   :(   :(  ....  >:(


mrmagoo

  • Beginner
  • *
  • Posts: 14
Re: When I change category, VM don't reset the page number
« Reply #3 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.
Code: [Select]
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.

mrmagoo

  • Beginner
  • *
  • Posts: 14
Re: When I change category, VM don't reset the page number
« Reply #4 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.

enock

  • Beginner
  • *
  • Posts: 40
Re: When I change category, VM don't reset the page number
« Reply #5 on: March 11, 2012, 06:06:07 am »
Thanks for trying mrmagoo but with this code in place you can't leave page one  :(

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10337
  • VirtueMart Version: 3+
Re: When I change category, VM don't reset the page number
« Reply #6 on: March 11, 2012, 11:49:17 am »
what version are you using? as far as I know pagination is solved
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

enock

  • Beginner
  • *
  • Posts: 40
Re: When I change category, VM don't reset the page number
« Reply #7 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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: When I change category, VM don't reset the page number
« Reply #8 on: March 12, 2012, 10:52:47 am »
I am quite sure this is fixed in the svn now.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

enock

  • Beginner
  • *
  • Posts: 40
Re: When I change category, VM don't reset the page number
« Reply #9 on: March 13, 2012, 03:32:51 am »
It's not in VM2.0.3B - so will see it in 2.0.3C?


mrmagoo

  • Beginner
  • *
  • Posts: 14
Re: When I change category, VM don't reset the page number
« Reply #11 on: March 26, 2012, 23:00:09 pm »
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

Code: [Select]
//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.

VlaKur

  • Beginner
  • *
  • Posts: 9
Re: When I change category, VM don't reset the page number
« Reply #12 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...

pnguyen

  • Beginner
  • *
  • Posts: 1
Re: When I change category, VM don't reset the page number
« Reply #13 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;
        }

joophilverink

  • Guest
Re: When I change category, VM don't reset the page number
« Reply #14 on: July 12, 2012, 12:13:39 pm »
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

Code: [Select]
//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??