4

我尝试在 /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。谢谢。

4

1 回答 1

0

尝试改变

->save;

->save();
于 2013-08-16T03:38:16.550 回答