Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pagination parameter from cumulative filter links #1739

Closed
tsarma opened this issue Nov 4, 2016 · 2 comments
Closed

Remove pagination parameter from cumulative filter links #1739

tsarma opened this issue Nov 4, 2016 · 2 comments
Labels
Milestone

Comments

@tsarma
Copy link
Contributor

tsarma commented Nov 4, 2016

I have a product list with a cumulative filter and pagination enabled. When you paginate, the links in filter contains page number page_iso parameter. This parameter leads to 404 page, when you click a link in filter, to which there is no sufficient products.
Therefore I think filter links should not contain pagination parameter.

Inside function generateOptionItem of Isotope\Module\CumulativeFilter you can do something like.

    protected function generateOptionItem($attribute, $label, $value, $matchCount, $isActive)
    {
        $value = base64_encode($this->id . ';' . ($isActive ? 'del' : 'add') . ';' . $attribute . ';' . $value);
        $href  = Url::addQueryString('cumulativefilter=' . $value);

        $arrParams = array_filter(array_keys($_GET), function($key) {
            return (strpos($key, 'page_iso') === 0);
        });

        $href = Url::removeQueryString($arrParams, $href);
        ...
        ...
    }
@aschempp aschempp added the bug label Dec 12, 2016
@aschempp aschempp added this to the 2.4.0 milestone Dec 12, 2016
@aschempp
Copy link
Member

Should be fixed in 953caf3. Let me know if that works :-)

@tsarma
Copy link
Contributor Author

tsarma commented Dec 14, 2016

👍 Yes this solves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants