1

I've done an upgrade on a Magento webshop and on the upgraded theme (Joomlart) I've got a problem with the layered navigation in combination with pagination. Was working before I did and upgrade. (Magento theme upgraded from 1.4.3.2 to 1.7)

I've recreated the problem with the theme template;

http://1d963b0e2ceac64a.builder.joomlart.com/pcgames/classic.html

(Updated site is still on staging server.)

Using the grid view, 9 articles.

The category has 41 products.

When I use shop by -> price ($0.00 - $999.99) (39 products) this generates the following slug: "/category/slug.html?price=-1000"

All good so far.

But if I want to see the following nine items priced ($0.00 - $999.99) and click page number 2 It gives this url; "/category/slug.html?p=2"

How can I make it so that the link will turn out like this; "/category/slug.html?price=-1000&p=2" ?

Would like to share some code but not quite sure which file I should touch?

1

I would start by looking at the following two files:

app/code/core/Mage/Page/Block/Html/Pager.php
app/design/frontend/base/default/template/page/html/pager.phtml

In the phtml file, it calls $this->getPageUrl($page). You can find this function in your block. Generally, the point of this function is to use your current url (notice the _current) but to replace the page variable with the relevant page (passing in param of page var name to relevant page):

public function getPageUrl($page)
{
    return $this->getPagerUrl(array($this->getPageVarName()=>$page));
}
public function getPagerUrl($params=array())
{
    $urlParams = array();
    $urlParams['_current']  = true;
    $urlParams['_escape']   = true;
    $urlParams['_use_rewrite']   = true;
    $urlParams['_query']    = $params;
    return $this->getUrl('*/*/*', $urlParams);
}

Obviously, your modified template can cause the location of these functionalities to change, so you'll need to investigate your code base a little for where it's getting cut off.

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.