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

Blog link not working #28

Closed
magefan opened this issue Jun 21, 2016 · 1 comment
Closed

Blog link not working #28

magefan opened this issue Jun 21, 2016 · 1 comment

Comments

@magefan
Copy link
Owner

magefan commented Jun 21, 2016

Blog link in category top navigation menu and footer do not work.
You get 403 or 404 error when clicking on it.
Link looks like mystore.com/.html

@magefan
Copy link
Owner Author

magefan commented Jun 21, 2016

Solution:
There is an issue in Amasty_ShopbySeo extension, that affect all url with length equal 4.
You need to edit file in Amasty_ShopbySeo extension:
app/code/Amasty/ShopbySeo/Helper/Url.php

and change removeCategorySuffix method, from

public function removeCategorySuffix($url)
    {
        $suffix = $this->scopeConfig->getValue('catalog/seo/category_url_suffix');
        if (strlen($suffix)) {
            $p = strrpos($url, $suffix);
            if ($p == strlen($url) - strlen($suffix)) {
                $url = substr($url, 0, $p);
            }
        }
        return $url;
    }

to

public function removeCategorySuffix($url)
    {
        $suffix = $this->scopeConfig->getValue('catalog/seo/category_url_suffix');
        if (strlen($suffix)) {
            $p = strrpos($url, $suffix);
            if (!$p) {
                return $url;
            }
            if ($p == strlen($url) - strlen($suffix)) {
                $url = substr($url, 0, $p);
            }
        }
        return $url;
    }

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

No branches or pull requests

1 participant