How to display customer address in Textarea insteadof selectbox in Checkout page in Mag

442 views Asked by At

I am trying to display all address of customer in Textarea in shipping address and billing address of checkout page instead of selectbox, where customer should have the option to choose among their list of address.Anybody help me to achieve it. Thanks in advance.

1

There are 1 answers

7
stalinrajindian On BEST ANSWER

Plesae remove/comment the dropdown and customize the file.Please try this way.

<?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 } ?>