Log in
Model

Url

Magento\Catalog\Model\Product\Url

What it does

This class handles the generation and formatting of product URLs in Magento 2.

Developers use it to get product URLs for different stores, apply URL rewrites, and format URL keys according to configuration settings.

It automatically resolves category-based URLs and handles URL parameters like store scope and SID (session ID) inclusion.

Public Methods

  • getUrlInStore()
  • getProductUrl()
  • formatUrlKey()
  • getUrl()