I need to get url_key attribute of a product, but I cannot.
I am calling this:
<?php $_helper = $this->helper('Magento\Catalog\Helper\Output'); $key = $_helper->productAttribute($_product, $_product->getUrlKey(), 'url_key') ?>
$product is an element of $_productCollection = $block->getLoadedProductCollection();
However, $key get empty. Of course, url key was entered in backend and I do see it in database also.
Any help will be appreciated.