Load Product By SKU In Magento



Suppose you want to load products by using the SKU, it is very simple and you can get it by using the code below. There are many ways to do it, in this post I have given the code which works for me in most of the cases.
<?php
	$prod_sku = "Product_Sku";
	$ProductId = Mage::getModel('catalog/product')
			          ->getIdBySku(trim($prod_sku));
	 
	// Initialiazation of the product model
	$products = Mage::getModel('catalog/product');
	 
	// Load specific product
	$products ->load($ProductId);
	print_r($products->getData());
?>

Hope it helps, Thanks for reading and enjoy the Magento coding.