Jump to content

How do I remove "page=nn" in the URL of product pages ?


Recommended Posts

  • 4 years later...
On 10/3/2019 at 2:44 PM, NemoPS dice:

You can't, you're better off using rel=canonical in categories. Just set the url to the base category url, without querystring parameters

Hi Nemo, how parameters can be removed from category urls into canonical?
I'm trying to remove pages like ?page=2 on PS8.
Into /controllers/front/listing/CategoryController.php i found this but I can't figure out where it's added the page parameter.

    protected $category;

    public function canonicalRedirection($canonicalURL = '')
    {
        if (Validate::isLoadedObject($this->category)) {
            parent::canonicalRedirection($this->context->link->getCategoryLink($this->category));
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getCanonicalURL()
    {
        if (!Validate::isLoadedObject($this->category)) {
            return '';
        }

        return $this->buildPaginatedUrl($this->context->link->getCategoryLink($this->category));
    }
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...