I am trying to get the product Id but below are given the conditions through which I want to get Id of the product. I have SKU of the product. but using that sku I want to get Id of that product. It is necessary condition to get product Id using SKU no other way I want....


1 Answer 1


use the product factory as explained here, then just use the $product->getIdBySku($sku) method.

  • thank you Diana Botean..Your quick response save my time a lot. Commented Feb 11, 2021 at 13:43
  • you're most welcome!
    – Diana
    Commented Feb 11, 2021 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.