How to get product details using product sku in magento

If you know your product SKU you can get details of that products, e.g- you can get Product Id, Product Name, Product Description, Product Price etc.
To get details fo the product by sku please write the below code

$products = Mage::getModel('catalog/product')
$_Pdetails = $product->loadByAttribute('sku', 'product-sku');


$_Pdetails =

echo $_Pdetails->getName();
echo $_Pdetails->getDescription();
echo $_Pdetails->getPrice();
echo $_Pdetails->getProductUrl();

No comments:

Post a Comment