我为客户制作了一个带有计算器的页面,他们不需要登录就可以使用它,该页面上有一个保存按钮,我想做的是:如果客户单击保存而没有登录,将被重定向到注册表窗体,如果用户成功注册,我需要将他在计算器中写的数据保存到他的帐户,然后重新重定向到计算器。他给客户添加了新的属性
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('customer', 'weight', array(
'label'=> 'Weight',
'type'=> 'decimal',
'input'=> 'text',
'visible'=> true,
'required'=> false,
));
$setup->addAttribute('customer', 'Height', array(
'label'=> 'Height',
'type'=> 'decimal',
'input'=> 'text',
'visible'=> true,
'required'=> false,
'position'=> 1,
));
$session = Mage::getSingleton('customer/session');
$customer = $session->getCustomer();
$customer->setWeight(80);
$customer->save();