First of all, i'm not familliar with apc.
It's turned on on my site. And i've been faced next problem: I need to get current page number in my custom block on products list page. But, when i input
echo Mage::getBlockSingleton('page/html_pager')->getCurrentPage();, i get same page number on all pages (i mean on pages with params /?p=2, /?p=3 it allways '1') untill i will clean apc cache. This number changes only after cleaning cache. Not on every page changes.

Any ideas?

  • Sounds like a problem with APC configuration, because APC should renew the cache when the file has changed. – Fabian Blechschmidt Aug 27 '14 at 15:00
  • no. File is not changet between page refreshes. changes only current page number, but echo still displays same result – Styopchik Aug 27 '14 at 16:30

What you describe can't be. (you know, these moments were... )

public function getCurrentPage()
    if ($page = (int) $this->getRequest()->getParam($this->getPageVarName())) {
        return $page;
    return 1;

The page is directly read from the request. So The only thing which comes in my mind is hooking into the method with xdebug and check what's wrong.

  • Most funny thing is that $this->getRequest()->getParams() returns also same array, no mater of page selected, or filter applied. – Styopchik Aug 27 '14 at 19:05
  • I mean. I insert echo $this->getRequest()->getParams(); in my template on product list. Then i go via pager block link to the next page. And i expect, that in array will be changed paramether 'p'. But it doesn't. Then i reload apache (clean apc cache) and only then array changes. – Styopchik Aug 27 '14 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.