Jump to content

Disable friendly urls only on category images


ahrboktrexon

Recommended Posts

Hey guys, I have a prestashop 1.7.8.5 and I am wondering if there is a way to disable friendly urls only on category images.

This is why my ps is running behind a reverse proxy with some optimization layer before (mod. pagespeed).

The problem is that, with friendly urls activated, pagespeed is not able to find the category image using the path he receives.

I already implemented the fix for product images following the following forum post, and it worked.

 

Is there a way to do the same also for categories?

Thank you

Link to comment
Share on other sites

ok found the solution by myself... it was easier than I though.

It is needed to override the getCatImageLink method like the following

    public function getCatImageLink($name, $idCategory, $type = null)
    {
        if ($this->allow == 1 && $type
                && false        //add this
        ) {
            $uriPath = __PS_BASE_URI__ . 'c/' . $idCategory . '-' . $type . '/' . $name . '.jpg';
        } else {
            $uriPath = _THEME_CAT_DIR_ . $idCategory . ($type ? '-' . $type : '') . '.jpg';
        }

        return $this->protocol_content . Tools::getMediaServer($uriPath) . $uriPath;
    }


 

Edited by ahrboktrexon (see edit history)
Link to comment
Share on other sites

  • 4 months later...
5 hours ago, Montana Roy said:

Yes, you can disable friendly URLs for product images in PrestaShop 1.7.8 by following these steps:

Log in to your PrestaShop admin panel.

Go to "Shop Parameters" and select "Traffic & SEO."

Scroll down to the "Schema of URLs" section.

Find the option "Use friendly URLs for product images" and toggle it to "No."

Click on "Save" to apply the changes

Hello! Thanks for answer. I don't have this option in 1.7.8. Check here please:

https://docs.prestashop-project.org/1.7-documentation/user-guide/configuring-shop/shop-parameters/traffic/seo-and-urls

I have 1.7.8.0 version but this options does not is not exists in any updated version -> 1.7.8.1-1.7.8.8. I just checked the changelogs here: https://www.prestashop.com/en/versions

Where did you find this option please!!?!?!?!?!?!?!? Maybe yoou have installed some module?

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...