Skip to content

Invalid SKU Handling for Linked Products in Magento

In Magento, it’s possible to save a product SKU as “0.” However, an issue occurs when this product is added as a linked product (such as Related Products, Up-Sells, or Cross-Sells) to another product. When attempting to make changes to the main product, it triggers an error: “The linked product SKU is invalid. Verify the data and try again.”

This issue arises in the file MagentoCatalogModelProductLinkRepository, specifically in the public function save, where the following condition is used:

 (!$entity->getLinkedProductSku()) {
        throw new NoSuchEntityException(__('The linked product SKU is invalid. Verify the 
   data and try again.'));
 }

enter image description here

enter image description here