Chủ Nhật, 21 tháng 11, 2010

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();

Không có nhận xét nào:

Đăng nhận xét