...
Code Block |
---|
class Category implements EntityInterface { public function getUrl(\Magento\Store\Api\Data\StoreInterface $store): string { $urlRewrite = $this->urlFinder->findOneByData([ 'target_path' => trim($this->request->getPathInfo(), '/'), 'store_id' => $store->getId() ]); if ($urlRewrite) { return $store->getBaseUrl() . $urlRewrite->getRequestPath(); } return $store->getCurrentUrl(false); } } |
If there is no $urlRewrite, we go into $store->getCurrentUrl(false) and also into below plugin
vendor/creativestyle/magesuite-seo-hreflang/Plugin/Model/Store.php:61
Code Block |
---|
class Store
{
public function aroundGetCurrentUrl(
\Magento\Store\Model\Store $subject,
callable $proceed,
$fromStore = true
): string {
if (version_compare($this->productMetadata->getVersion(), '2.3.5', '<')) {
$sidQueryParam = $this->sidResolver->getSessionIdQueryParam($this->_getSession($subject->getCode()));
}
.....
$currentUrl = $storeParsedUrl->getScheme()
. '://'
. $storeParsedUrl->getHost()
. (!$isDefaultPort ? ':' . $storeParsedUrl->getPort() : '')
. $storeParsedUrl->getPath()
. $requestString
. ($storeParsedQuery ? '?' . http_build_query($storeParsedQuery) : '');
return $currentUrl;
}
} |
Frontend
There is no frontend functionality in this module.