Php 如何在magento的一页签出模块中访问帐单地址元素?

Php 如何在magento的一页签出模块中访问帐单地址元素?,php,codeigniter,magento-1.7,Php,Codeigniter,Magento 1.7,在一页中,当我调用getCustomerBloddr()函数时签出模块。它将查找完整地址。我想得到不同的地址元素,如姓名、城市等。 我怎么能得到这个? 如何尽可能使用format函数?对于通过getCustomerBillingAddress方法返回的对象,您可以执行以下操作: $street = $address->getStreet();//or $address->getData('street') $country = $address->getCountryId();

在一页中,当我调用getCustomerBloddr()函数时签出模块。它将查找完整地址。我想得到不同的地址元素,如姓名、城市等。 我怎么能得到这个?
如何尽可能使用format函数?

对于通过
getCustomerBillingAddress
方法返回的对象,您可以执行以下操作:

$street = $address->getStreet();//or $address->getData('street')
$country = $address->getCountryId();//or $address->getData('country_id');
基本上,地址的
$\u data
成员中的任何元素都可以这样调用

[编辑]
您可以通过以下方式获取客户账单地址:

$address = $this->getCustomer()->getPrimaryBillingAddress()

然后您可以执行以下操作:
$address->getStreet()
和其他操作。

此错误即将发生:致命错误:在/var/www/shop/app/design/frontend/base/default/template/onepagecheckout/onepage/billing.phtml中对非对象调用成员函数getData()。要访问的其他选项是什么?正如您所说,
getCustomerBillAddr()
返回的代码。输出:string(66)“abhi1 agarwal,c-3/23印度新德里拉古里花园110048”/
来自调用此代码:getCustomerBillAddr(){$address=$this->getCustomer()->>getPrimaryBillingAddress();$addr=$address->$address->format('oneline'));return$addr;}}哦……我误解了你的问题。对不起。我已经更新了答案。我希望这次我做对了。非常感谢!!!!现在它可以通过使用:$this->getQuote()->getBillingAddress()完美地工作;