如何将地址设置为默认值

时间:2013-06-10 16:07:36

标签: magento

我尝试在/controllers/OnepageController.php中将地址设置为默认值:

     $customer = Mage::getSingleton('customer/session')->getCustomer();

     foreach ($customer->getAddresses() as $address){
            $addressType = $address->getCustom_address_type();
            if ($addressType == 'school'){
                Mage::log("SetAddressDefault", null, 'mygento.log');
                $address->setCustomerId($customer->getId())
                        ->setIsDefaultBilling('1')
                        ->save;
            }
        }

我已经检查了日志,条件得到了满足。为什么setDefaultBilling方法不执行?

我使用magento 1.7。感谢。

1 个答案:

答案 0 :(得分:1)

尝试更改

->save;

->save();
相关问题