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

Upload an image in the attribute
 
amine2005
Jr. Member
 
Total Posts:  23
Joined:  2008-09-11
 

hello
when adding a new attribute and when you select the input type (drop drown ......) I add a similar type and in the selection manage label when you click Add option I display button also allows me to upload an image.

I added this code in the civil Option.php prepareLayout

protected function _prepareLayout() 
    

        $uploader 
$this->getLayout()->createBlock('adminhtml/media_uploader'); 
        
$this->setChild('browse_button',$uploader); 
        
$this->getUploader()->getConfig() 
            ->
setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/catalog_product_gallery/upload')) 
            ->
setFileField('image'
            ->
setFilters(array( 
                
'images' => array( 
                    
'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png)'), 
                    
'files' => array('*.gif''*.jpg','*.jpeg''*.png'
                ) 
            )); 
             
        return 
parent::_prepareLayout(); 
    
}

thx for help!!!!!

if someone have other idea will be appreciate to find the solution

 
Magento Community Magento Community
Magento Community
Magento Community
 
amine2005
Jr. Member
 
Total Posts:  23
Joined:  2008-09-11
 

s

 
Magento Community Magento Community
Magento Community
Magento Community
 
amine2005
Jr. Member
 
Total Posts:  23
Joined:  2008-09-11
 

hello all
Indeed, I summarize what I want to do is to add the block of media uploader in the options of an attribute. For example, to attribute the color you click on add option to include different colors.i want to add it at the click add option I can also choose a picture to color as I mentioned for example the colors are black and blue as I want to display picture black for the color black and a picture bleu for the color blue

any idea please????

http://i36.tinypic.com/1zwho3p.jpg

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top