Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Display a specific product in the left column
 
donfeiler
Jr. Member
 
Total Posts:  4
Joined:  2009-04-08
 

We have exactly one product that we wish to feature in a callout box in the left column. I have accomplished this by hard-coding the thumbnail image and product name, and have successfully created an addtocart form as well. What I do not know how to do is dynamically call the price of the item. What i would like to do is address the item by its ID (happens to be ID=1) and pull the price, thumbnail, and store url of the item instead of hard coding. Anyone know how?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

How much writing do you want to do?

I think these function will do most of the work. You will need to create a module

public function getViewProduct($productId)
    
{
        $html 
'<div id="productLabel'.$productId.'"><h3 class="product-name">';
        
$obj = new Wdc_Catalog_Model_Product();
        
$html.= $obj->_getProductName($productId);
        
$html.= '</h3></div>';
        
        return 
$html;    
    
}
    
    
public function getProductUrl($_productid)
    
{
        $obj 
= new Wdc_Catalog_Model_Product();
        return 
$obj->_getProductUrl($_productid570);
    
}
    
    
    
public function getPrice($_productid)
    
{
        $obj 
= new Wdc_Catalog_Model_Product();
        return 
$obj->_getPrice($_productid);
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top