I want to show the billing address in a div
not in select type box.
In billing.phtml
file
<div class="input-box">
<?php echo $this->getAddressesHtmlSelect('billing') ?>
</div>
This statement is creating select box and displaying the address.
Here is the code in Checkout_Block_Onepage_Abstract.php
public function getAddressesHtmlSelect($type)
{
if ($this->isCustomerLoggedIn()) {
$options = array();
foreach ($this->getCustomer()->getAddresses() as $address) {
$options[] = array(
'value' => $address->getId(),
'label' => $address->format('oneline')
);
}
$addressId = $this->getAddress()->getCustomerAddressId();
Mage::log($addressId,null,'address.log');
if (empty($addressId)) {
if ($type=='billing') {
$address = $this->getCustomer()->getPrimaryBillingAddress();
} else {
$address = $this->getCustomer()->getPrimaryShippingAddress();
}
if ($address) {
$addressId = $address->getId();
}
}
$select = $this->getLayout()->createBlock('core/html_select')
->setName($type.'_address_id')
->setId($type.'-address-select')
->setClass('address-select')
->setExtraParams('onchange="'.$type.'.newAddress(!this.value)"')
->setValue($addressId)
->setOptions($options);
$select->addOption('', Mage::helper('checkout')->__('New Address'));
return $select->getHtml();
}
return '';
}
This function is returning the address.
Best Answer
There is no in build function to list the customer address as div
You have get the customer address by following code
use the below code after this
and hide the address select box (i.e., Display:none)
then add the below
script