Tuesday, 26 May 2015

How to Get Product details Using Product Id in Magento

If you got the product id then you can get details of a product by using the following method in magento.

$obj = Mage::getModel('catalog/product');
$_product = $obj->load($product_id); // Enter your Product Id in $product_id
// get Product's name
echo $_product->getName();
//get product's short description
echo $_product->getShortDescription();
//get Product's Long Description
echo $_product->getDescription();
//get Product's Regular Price
echo $_product->getPrice();
//get Product's Special price
echo $_product->getSpecialPrice();
//get Product's Url
echo $_product->getProductUrl();
//get Product's image Url
echo $_product->getImageUrl();


No comments:

Post a Comment

about new GraphQL freature in Magento2

GraphQL: GraphQL is a data query language developed internally by Facebook in 2012 before being publicly released in 2015. Magento impleme...