I have a custom category indexer which grabs Magento categories and index them to a search service. Within each category I need to index it's URL which I do by code
$url = $category->getUrl();
$category is instance of
The issue is when the store is set to use Secure URLs in front end. Then this code always return the not-secure URL. Do you know how to get the secure one?
With product I solved it with code
$url = $product->getUrlModel()->getUrl($product, ['_secure' => true]);
$url = $product->getProductUrl(); returned a not-secure URL as well.
However from Category I don't have access to any
UrlModel or any way how to pass
_secure parameter to
Thanks for any help!