Log in
Model

Link

Magento\Catalog\Model\Product\Link

What it does

This class manages product link relationships in Magento 2, such as related products, up-sell products, and cross-sell products.

Developers use this model to create, retrieve, and save product associations that help with merchandising strategies by linking products together.

It provides methods to set the link type and access collections of linked products.

Public Methods

  • useRelatedLinks()
  • useUpSellLinks()
  • useCrossSellLinks()
  • getAttributeTypeTable()
  • getProductCollection()
  • getLinkCollection()
  • getAttributes()
  • saveProductRelations()