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

Save Multiselect data
 
HelloThemes [PM]
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2009-01-12
Argentina
 

Hi!!!
I add a Multiselect in my new extension, it’s very nice but i can’t save the data.
I am modified save() in IndexControllers.php.
I get all getParams.
BUT I CAN’T SAVE.
Can someone help me?
Thanks!

[----CODE----]

public function saveAction()
    
{
        
if ($postData $this->getRequest()->getParams()) {


            $model 
Mage::getModel('correo/servicios');
            
$model
                
->setData($postData)
                ->
setId($this->getRequest()->getParam('id'));

            try 
{
                $model
->save();
                
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('correo')->__('Item was successfully saved'));
                
Mage::getSingleton('adminhtml/session')->setFormData(false);

                if (
$this->getRequest()->getParam('back')) {
                    $this
->_redirect('*/*/edit', array('id' => $model->getId()));
                    return;
                
}
                $this
->_redirect('*/*/');
                return;
            
}
            
catch (Mage_Core_Exception $e{
                Mage
::getSingleton('adminhtml/session')->addError($e->getMessage());
            
}
            
catch (Exception $e{
                Mage
::getSingleton('adminhtml/session')->addError(Mage::helper('correos')->__('Error while saving this shipping rule. Please try again later.'));
            
}

            Mage
::getSingleton('adminhtml/session')->setRuleData($postData);
            
$this->_redirectReferer();
        
}
    }
[----/CODE----]
 
Magento Community Magento Community
Magento Community
Magento Community
 
HelloThemes [PM]
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2009-01-12
Argentina
 

Can someone help me please?
I only need save data from multiselect!!
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
HelloThemes [PM]
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2009-01-12
Argentina
 

We solved.
Converted the array in string separately by , and ready.
Sometimes is better to be a time to think in cold, jeje
Greetings!

 
Magento Community Magento Community
Magento Community
Magento Community
 
factorymediaweb
Jr. Member
 
Total Posts:  15
Joined:  2008-11-10
 

Hi mrghost, could you please tell me how you did this? Thanks!

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