我试图在Textarea中显示客户的所有地址,在结账页面的发货地址和账单地址而不是selectbox,客户应该可以选择在他们的地址列表中选择。任何人帮助我实现它。提前谢谢。
答案 0 :(得分:0)
Plesae删除/评论下拉列表并自定义文件。请尝试这种方式。
<?php
$session = Mage::getSingleton('customer/session');
$cidData = $session->isLoggedIn();
$cidvar = $session->getId();
$customer = Mage::getModel('customer/customer')
->load($cidvar); //put customer id here
$data = array();
$i = 0;
foreach ($customer->getAddresses() as $address) {
$data[$i] = $address->toArray();
$i++;
}
foreach ($data as $values) {
?>
<div id="<?php echo $values['entity_id'] ?>">
<pre>
<strong><?php echo $values['firstname']; ?></strong>
<?php echo $values['city']; ?>
<?php echo $values['region']; ?>
<?php echo $values['street']; ?>
</pre>
<form>
<p>
<a class="group1" href="<?php echo Mage::getBaseUrl() . 'customer/address/edit/id/' . $values['entity_id']; ?>?popupEdit=1&meth=billing" >
<input type="button" value="EDIT" class="gray_btn"/>
</a>
</p>
</form>
</div>
</div>
<?php } ?>