protected function formatUrl($unformedUrl)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $params = explode('?', $unformedUrl);
        $pageParams = isset($params[1]) ? $params[1] : null;
        $params = explode('/', $params[0]);
        $className = $params[0];

        $header = ($className) ? "cl=$className&" : '';  // adding view name
        $header .= ($pageParams) ? "$pageParams&" : '';   // adding page params
        $header .= $this->getSession()->sid();            // adding session Id

        $url = $myConfig->getCurrentShopUrl($this->isAdmin());

        $url = "{$url}index.php?{$header}";

        $url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($url);

        $seoIsActive = \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive();
        if ($seoIsActive && $seoUrl = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->getStaticUrl($url)) {
            $url = $seoUrl;
        }

        return $url;
    }