Pages

Tuesday, May 8, 2012

Magento update checkboxes in frontend edit registration page code


app\code\core\Mage\Customer\controllers\AccountController.php
 
             /**
             * we would like to preserver the existing group id
             */
            if ($this->_getSession()->getCustomerGroupId()) {
                $customer->setGroupId($this->_getSession()->getCustomerGroupId());
            }

            /**
             * Custom coding for Promoted Update & Rented Update by Leo
             */
            if ($this->getRequest()->getParam('ATTRIBUTE_CODE')) {
                $customer->setATTRIBUTE_CODE(1);
            } else {
                $customer->setATTRIBUTE_CODE(0);
            }
            /**
             * End
             */

From this customizing user can update checkboxes values from edit registration page frontside in Magento if user has checkbox fields in registration of his magento site. Replace 'ATTRIBUTE_CODE' with your checkbox attribute code.

No comments:

Post a Comment