book.phtml 5.24 KB
Newer Older
John Punzalan's avatar
John Punzalan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     default_iphone
 * @copyright   Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Temlate for Mage_Customer_Block_Address_Book block
 * @var $test Mage_Customer_Block_Address_Book
 */
?>
<div class="page-title title-buttons">
    <h1><?php echo $this->__('Address Book') ?></h1>
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Add New Address')) ?>" class="button" onclick="window.location='<?php echo $this->getAddAddressUrl() ?>';"><span><span><?php echo $this->__('Add New Address') ?></span></span></button>
</div>
<?php echo $this->getMessagesBlock()->toHtml() ?>
<div class="col2-set addresses-list">
    <div class="col-1 addresses-primary">
        <h2 class="sub-title"><?php echo $this->__('Default Addresses') ?></h2>
        <ol>
        <?php if($_pAddsses = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling()): ?>
            <li class="info-box">
                <h3 class="box-title"><?php echo $this->__('Default Billing Address') ?> <span class="separator">|</span> <a href="<?php echo $this->getAddressEditUrl(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>"><?php echo $this->__('Edit') ?></a></h3>
                <address class="box-content">
                <?php echo $this->getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>
                </address>
           </li>
        <?php else: ?>
            <li class="info-box">
                <h3 class="box-title"><?php echo $this->__('Default Billing Address') ?></h3>
                <p class="box-content"><?php echo $this->__('You have no default billing address in your address book.') ?></p>
            </li>
        <?php endif ?>

        <?php if($_pAddsses = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping()): ?>
            <li class="info-box">
                <h3 class="box-title"><?php echo $this->__('Default Shipping Address') ?> <span class="separator">|</span> <a href="<?php echo $this->getAddressEditUrl(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>"><?php echo $this->__('Edit') ?></a></h3>
                <address class="box-content">
                    <?php echo $this->getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>
                </address>
            </li>
        <?php else: ?>
            <li class="info-box">
                <h3 class="box-title"><?php echo $this->__('Default Shipping Address') ?></h3>
                <p class="box-content"><?php echo $this->__('You have no default shipping address in your address book.') ?></p>
            </li>
        <?php endif ?>
        </ol>
    </div>
    <div class="col-2 addresses-additional">
        <h2 class="sub-title"><?php echo $this->__('Additional Address Entries') ?></h2>
        <ol>
        <?php if($_pAddsses = $this->getAdditionalAddresses()): ?>
            <?php foreach($_pAddsses as $_address): ?>
            <li class="item">
                <address>
                    <?php echo $this->getAddressHtml($_address) ?><br />
                </address>
                <p class="actions">
                    <a href="<?php echo $this->getUrl('customer/address/edit', array('id'=>$_address->getId())) ?>"><?php echo $this->__('Edit Address') ?></a>
                    <span class="separator">|</span>
                    <a href="#" onclick="return deleteAddress('<?php echo $_address->getId() ?>');"><?php echo $this->__('Delete Address') ?></a>
                </p>
            </li>
            <?php endforeach; ?>
        <?php else: ?>
            <li class="item empty">
                <p><?php echo $this->__('You have no additional address entries in your address book.') ?></p>
            </li>
        <?php endif ?>
        </ol>
    </div>
</div>
<div class="buttons-set">
    <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
</div>
<script type="text/javascript">
//<![CDATA[
    function deleteAddress(addressId) {
        if(confirm('<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Are you sure you want to delete this address?')) ?>')) {
            window.location='<?php echo $this->getDeleteUrl() ?>id/'+addressId;
        }
        return false;
    }
//]]>
</script>