Log in
Repository

ProductWebsiteLinkRepositoryInterface

Magento\Catalog\Api\ProductWebsiteLinkRepositoryInterface

What it does

This repository interface manages the assignment of products to websites in a multi-website Magento 2 setup.

Developers use this when they need to programmatically assign or unassign products to specific websites, which is essential for controlling product visibility across different storefronts.

It provides methods to save product-website relationships, remove them by object or by product SKU and website ID.

Public Methods

  • save()
  • delete()
  • deleteById()