75 : $this->categoryUrlPathGenerator->getUrlPath(
$category) .
'/' .
$path;
86 $storedProduct = $this->productRepository->getById(
$product->getId());
87 $storedUrlKey = $storedProduct->getUrlKey();
88 return $storedUrlKey ?:
$product->formatUrlKey($storedProduct->getName());
126 return (
$product->getUrlKey() ===
false || empty($generatedProductUrlKey)) ?
null : $generatedProductUrlKey;
138 return $product->formatUrlKey($urlKey ===
'' || $urlKey ===
null ?
$product->getName() : $urlKey);
150 $storeId = $this->storeManager->getStore()->getId();
153 if (!isset($this->productUrlSuffix[
$storeId])) {
154 $this->productUrlSuffix[
$storeId] = $this->scopeConfig->getValue(
155 self::XML_PATH_PRODUCT_URL_SUFFIX,
160 return $this->productUrlSuffix[
$storeId];
getUrlPath($product, $category=null)
prepareProductDefaultUrlKey(\Magento\Catalog\Model\Product $product)
$categoryUrlPathGenerator
__construct(\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator $categoryUrlPathGenerator, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository)
const XML_PATH_PRODUCT_URL_SUFFIX
getCanonicalUrlPath($product, $category=null)
prepareProductUrlKey(\Magento\Catalog\Model\Product $product)
getUrlPathWithSuffix($product, $storeId, $category=null)
getProductUrlSuffix($storeId=null)