Version Notes
First Preview Release
Download this release
Release Info
Developer | Ankit Dalal |
Extension | Ankit_Address |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/community/Ankit/Address/Block/Address.php +5 -0
- app/code/community/Ankit/Address/Helper/Data.php +5 -0
- app/code/community/Ankit/Address/etc/config.xml +119 -0
- app/code/community/Ankit/Address/etc/system.xml +44 -0
- app/code/community/Ankit/Address/sql/address_setup/mysql4-install-0.1.0.php +44 -0
- app/design/frontend/base/default/layout/address.xml +21 -0
- app/design/frontend/base/default/template/address/checkout/onepage/billing.phtml +189 -0
- app/design/frontend/base/default/template/address/checkout/onepage/shipping.phtml +167 -0
- app/design/frontend/base/default/template/address/customer/address/edit.phtml +164 -0
- app/design/frontend/base/default/template/address/persistent/checkout/onepage/billing.phtml +224 -0
- app/design/frontend/base/default/template/address/persistent/customer/form/register.phtml +164 -0
- app/etc/modules/Ankit_Address.xml +10 -0
- package.xml +18 -0
app/code/community/Ankit/Address/Block/Address.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ankit_Address_Block_HelloWorld extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
// necessary methods
|
5 |
+
}
|
app/code/community/Ankit/Address/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ankit_Address_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/community/Ankit/Address/etc/config.xml
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<default>
|
4 |
+
<add_suburb_field>
|
5 |
+
<ankit_address_settings>
|
6 |
+
<enable>1</enable>
|
7 |
+
</ankit_address_settings>
|
8 |
+
</add_suburb_field>
|
9 |
+
</default>
|
10 |
+
|
11 |
+
<adminhtml>
|
12 |
+
<acl>
|
13 |
+
<resources>
|
14 |
+
<admin>
|
15 |
+
<children>
|
16 |
+
<system>
|
17 |
+
<children>
|
18 |
+
<config>
|
19 |
+
<children>
|
20 |
+
<add_suburb_field translate="label" module="address">
|
21 |
+
<label>Suburb</label>
|
22 |
+
<sort_order>99999</sort_order>
|
23 |
+
</add_suburb_field>
|
24 |
+
</children>
|
25 |
+
</config>
|
26 |
+
</children>
|
27 |
+
</system>
|
28 |
+
</children>
|
29 |
+
</admin>
|
30 |
+
</resources>
|
31 |
+
</acl>
|
32 |
+
</adminhtml>
|
33 |
+
|
34 |
+
<modules>
|
35 |
+
<Ankit_Address>
|
36 |
+
<version>0.1.0</version>
|
37 |
+
</Ankit_Address>
|
38 |
+
</modules>
|
39 |
+
<frontend>
|
40 |
+
<routers>
|
41 |
+
<address>
|
42 |
+
<use>standard</use>
|
43 |
+
<args>
|
44 |
+
<module>Ankit_Address</module>
|
45 |
+
<frontName>address</frontName>
|
46 |
+
</args>
|
47 |
+
</address>
|
48 |
+
</routers>
|
49 |
+
<layout>
|
50 |
+
<updates>
|
51 |
+
<address>
|
52 |
+
<file>address.xml</file>
|
53 |
+
</address>
|
54 |
+
</updates>
|
55 |
+
</layout>
|
56 |
+
</frontend>
|
57 |
+
<global>
|
58 |
+
<models>
|
59 |
+
<address>
|
60 |
+
<class>Ankit_Address_Model</class>
|
61 |
+
<resourceModel>address_mysql4</resourceModel>
|
62 |
+
</address>
|
63 |
+
<address_mysql4>
|
64 |
+
<class>Ankit_Address_Model_Mysql4</class>
|
65 |
+
<entities>
|
66 |
+
<address>
|
67 |
+
<table>address</table>
|
68 |
+
</address>
|
69 |
+
</entities>
|
70 |
+
</address_mysql4>
|
71 |
+
</models>
|
72 |
+
<resources>
|
73 |
+
<address_setup>
|
74 |
+
<setup>
|
75 |
+
<module>Ankit_Address</module>
|
76 |
+
<class>Mage_Customer_Model_Entity_Setup</class>
|
77 |
+
</setup>
|
78 |
+
<connection>
|
79 |
+
<use>core_setup</use>
|
80 |
+
</connection>
|
81 |
+
</address_setup>
|
82 |
+
<address_write>
|
83 |
+
<connection>
|
84 |
+
<use>core_write</use>
|
85 |
+
</connection>
|
86 |
+
</address_write>
|
87 |
+
<address_read>
|
88 |
+
<connection>
|
89 |
+
<use>core_read</use>
|
90 |
+
</connection>
|
91 |
+
</address_read>
|
92 |
+
</resources>
|
93 |
+
<blocks>
|
94 |
+
<address>
|
95 |
+
<class>Ankit_Address_Block</class>
|
96 |
+
</address>
|
97 |
+
</blocks>
|
98 |
+
<helpers>
|
99 |
+
<address>
|
100 |
+
<class>Ankit_Address_Helper</class>
|
101 |
+
</address>
|
102 |
+
</helpers>
|
103 |
+
</global>
|
104 |
+
<global>
|
105 |
+
<fieldsets>
|
106 |
+
<sales_convert_quote_address>
|
107 |
+
<suburb>
|
108 |
+
<to_order_address>*</to_order_address>
|
109 |
+
<to_customer_address>*</to_customer_address>
|
110 |
+
</suburb>
|
111 |
+
</sales_convert_quote_address>
|
112 |
+
<customer_address>
|
113 |
+
<suburb>
|
114 |
+
<to_quote_address>*</to_quote_address>
|
115 |
+
</suburb>
|
116 |
+
</customer_address>
|
117 |
+
</fieldsets>
|
118 |
+
</global>
|
119 |
+
</config>
|
app/code/community/Ankit/Address/etc/system.xml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<suburb translate="label" module="address">
|
5 |
+
<label>Suburb</label>
|
6 |
+
<sort_order>99999</sort_order>
|
7 |
+
</suburb>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<add_suburb_field translate="label" module="address">
|
11 |
+
<label>Add Suburb Field</label>
|
12 |
+
<tab>suburb</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>1000</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<ankit_address_settings translate="label">
|
20 |
+
<label>Settings</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>10</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<enable translate="label">
|
28 |
+
<label>Add Suburb Field</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>0</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<comment>Use this to enable / disable the suburb field.</comment>
|
36 |
+
</enable>
|
37 |
+
|
38 |
+
</fields>
|
39 |
+
</ankit_address_settings>
|
40 |
+
</groups>
|
41 |
+
</add_suburb_field>
|
42 |
+
</sections>
|
43 |
+
</config>
|
44 |
+
|
app/code/community/Ankit/Address/sql/address_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$this->addAttribute('customer_address', 'suburb', array(
|
8 |
+
'type' => 'varchar',
|
9 |
+
'input' => 'text',
|
10 |
+
'label' => 'Suburb',
|
11 |
+
'global' => 1,
|
12 |
+
'visible' => 1,
|
13 |
+
'required' => 0,
|
14 |
+
'user_defined' => 1,
|
15 |
+
'visible_on_front' => 1
|
16 |
+
));
|
17 |
+
|
18 |
+
|
19 |
+
if (version_compare(Mage::getVersion(), '1.6.0', '<='))
|
20 |
+
{
|
21 |
+
$customer = Mage::getModel('customer/address');
|
22 |
+
$attrSetId = $customer->getResource()->getEntityType()->getDefaultAttributeSetId();
|
23 |
+
$this->addAttributeToSet('customer_address', $attrSetId, 'General', 'suburb');
|
24 |
+
}
|
25 |
+
|
26 |
+
if (version_compare(Mage::getVersion(), '1.4.2', '>='))
|
27 |
+
{
|
28 |
+
Mage::getSingleton('eav/config')
|
29 |
+
->getAttribute('customer_address', 'suburb')
|
30 |
+
->setData('used_in_forms', array('customer_register_address','customer_address_edit','adminhtml_customer_address'))
|
31 |
+
->save();
|
32 |
+
}
|
33 |
+
|
34 |
+
$tablequote = $this->getTable('sales/quote_address');
|
35 |
+
$installer->run("
|
36 |
+
ALTER TABLE $tablequote ADD `suburb` varchar(255) NOT NULL
|
37 |
+
");
|
38 |
+
|
39 |
+
$tablequote = $this->getTable('sales/order_address');
|
40 |
+
$installer->run("
|
41 |
+
ALTER TABLE $tablequote ADD `suburb` varchar(255) NOT NULL
|
42 |
+
");
|
43 |
+
|
44 |
+
$installer->endSetup();
|
app/design/frontend/base/default/layout/address.xml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<customer_account_create>
|
4 |
+
<reference name='customer_form_register'>
|
5 |
+
<action method='setTemplate' ifconfig='add_suburb_field/ankit_address_settings/enable'><template>address/persistent/customer/form/register.phtml</template></action>
|
6 |
+
</reference>
|
7 |
+
</customer_account_create>
|
8 |
+
<customer_address_form>
|
9 |
+
<reference name='customer_address_edit'>
|
10 |
+
<action method='setTemplate' ifconfig='add_suburb_field/ankit_address_settings/enable'><template>address/customer/address/edit.phtml</template></action>
|
11 |
+
</reference>
|
12 |
+
</customer_address_form>
|
13 |
+
<checkout_onepage_index>
|
14 |
+
<reference name='checkout.onepage.billing'>
|
15 |
+
<action method='setTemplate' ifconfig='add_suburb_field/ankit_address_settings/enable'><template>address/checkout/onepage/billing.phtml</template></action>
|
16 |
+
</reference>
|
17 |
+
<reference name='checkout.onepage.shipping'>
|
18 |
+
<action method='setTemplate' ifconfig='add_suburb_field/ankit_address_settings/enable'><template>address/checkout/onepage/shipping.phtml</template></action>
|
19 |
+
</reference>
|
20 |
+
</checkout_onepage_index>
|
21 |
+
</layout>
|
app/design/frontend/base/default/template/address/checkout/onepage/billing.phtml
ADDED
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<form id="co-billing-form" action="">
|
2 |
+
<fieldset>
|
3 |
+
<ul class="form-list">
|
4 |
+
<?php if ($this->customerHasAddresses()): ?>
|
5 |
+
<li class="wide">
|
6 |
+
<label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
|
7 |
+
<div class="input-box">
|
8 |
+
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
9 |
+
</div>
|
10 |
+
</li>
|
11 |
+
<?php endif; ?>
|
12 |
+
<li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
|
13 |
+
<fieldset>
|
14 |
+
<input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
|
15 |
+
<ul>
|
16 |
+
<li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
|
17 |
+
<li class="fields">
|
18 |
+
<div class="field">
|
19 |
+
<label for="billing:company"><?php echo $this->__('Company') ?></label>
|
20 |
+
<div class="input-box">
|
21 |
+
<input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
25 |
+
<div class="field">
|
26 |
+
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
27 |
+
<div class="input-box">
|
28 |
+
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
29 |
+
</div>
|
30 |
+
</div>
|
31 |
+
<?php endif ?>
|
32 |
+
</li>
|
33 |
+
<li class="wide">
|
34 |
+
<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
35 |
+
<div class="input-box">
|
36 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" />
|
37 |
+
</div>
|
38 |
+
</li>
|
39 |
+
<?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
|
40 |
+
<li class="wide">
|
41 |
+
<div class="input-box">
|
42 |
+
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" />
|
43 |
+
</div>
|
44 |
+
</li>
|
45 |
+
<?php endfor ?>
|
46 |
+
<li class="fields">
|
47 |
+
<div class="field">
|
48 |
+
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
49 |
+
<div class="input-box">
|
50 |
+
<?php echo $this->getCountryHtmlSelect('billing') ?>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<div class="field">
|
55 |
+
<label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
56 |
+
<div class="input-box">
|
57 |
+
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
58 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
59 |
+
</select>
|
60 |
+
<script type="text/javascript">
|
61 |
+
//<![CDATA[
|
62 |
+
$('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
63 |
+
//]]>
|
64 |
+
</script>
|
65 |
+
<input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
</li>
|
69 |
+
<li class="fields">
|
70 |
+
<div class="field">
|
71 |
+
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
72 |
+
<div class="input-box">
|
73 |
+
<input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="input-text required-entry" id="billing:city" />
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
<div class="field">
|
77 |
+
<label for="suburb" class="required"><em>*</em><?php echo $this->__('Suburb') ?></label>
|
78 |
+
<div class="input-box">
|
79 |
+
<input type="text" name="billing[suburb]" value="<?php echo $this->htmlEscape($this->getAddress()->getSuburb()) ?>" title="<?php echo $this->__('Suburb') ?>" id="billing:suburb" class="input-text required-entry" />
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</li>
|
83 |
+
|
84 |
+
<li class="fields">
|
85 |
+
<div class="field">
|
86 |
+
<label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
87 |
+
<div class="input-box">
|
88 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international required-entry" />
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
</li>
|
92 |
+
<li class="fields">
|
93 |
+
<div class="field">
|
94 |
+
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
95 |
+
<div class="input-box">
|
96 |
+
<input type="text" name="billing[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="billing:telephone" />
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<div class="field">
|
100 |
+
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
|
101 |
+
<div class="input-box">
|
102 |
+
<input type="text" name="billing[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text" id="billing:fax" />
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
</li>
|
106 |
+
|
107 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
108 |
+
|
109 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
110 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
111 |
+
<?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
|
112 |
+
<li class="fields">
|
113 |
+
<?php if ($_dob->isEnabled()): ?>
|
114 |
+
<div class="field">
|
115 |
+
<?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
116 |
+
</div>
|
117 |
+
<?php endif; ?>
|
118 |
+
<?php if ($_gender->isEnabled()): ?>
|
119 |
+
<div class="field">
|
120 |
+
<?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
121 |
+
</div>
|
122 |
+
<?php endif ?>
|
123 |
+
</li>
|
124 |
+
<?php endif ?>
|
125 |
+
|
126 |
+
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
|
127 |
+
<?php if ($_taxvat->isEnabled()): ?>
|
128 |
+
<li>
|
129 |
+
<?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
130 |
+
</li>
|
131 |
+
<?php endif ?>
|
132 |
+
|
133 |
+
|
134 |
+
<li class="fields" id="register-customer-password">
|
135 |
+
<div class="field">
|
136 |
+
<label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
137 |
+
<div class="input-box">
|
138 |
+
<input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
<div class="field">
|
142 |
+
<label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
143 |
+
<div class="input-box">
|
144 |
+
<input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
|
145 |
+
</div>
|
146 |
+
</div>
|
147 |
+
</li>
|
148 |
+
<?php endif; ?>
|
149 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
150 |
+
<li class="control">
|
151 |
+
<input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
|
152 |
+
</li>
|
153 |
+
<?php else:?>
|
154 |
+
<li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
|
155 |
+
<?php endif; ?>
|
156 |
+
</ul>
|
157 |
+
</fieldset>
|
158 |
+
</li>
|
159 |
+
<?php if ($this->canShip()): ?>
|
160 |
+
<li class="control">
|
161 |
+
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
|
162 |
+
<li class="control">
|
163 |
+
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
|
164 |
+
</li>
|
165 |
+
<?php endif; ?>
|
166 |
+
</ul>
|
167 |
+
<?php if (!$this->canShip()): ?>
|
168 |
+
<input type="hidden" name="billing[use_for_shipping]" value="1" />
|
169 |
+
<?php endif; ?>
|
170 |
+
<div class="buttons-set" id="billing-buttons-container">
|
171 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
172 |
+
<button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
173 |
+
<span class="please-wait" id="billing-please-wait" style="display:none;">
|
174 |
+
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
|
175 |
+
</span>
|
176 |
+
</div>
|
177 |
+
</fieldset>
|
178 |
+
</form>
|
179 |
+
<script type="text/javascript">
|
180 |
+
//<![CDATA[
|
181 |
+
var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
|
182 |
+
var billingForm = new VarienForm('co-billing-form');
|
183 |
+
|
184 |
+
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
|
185 |
+
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
|
186 |
+
|
187 |
+
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
|
188 |
+
//]]>
|
189 |
+
</script>
|
app/design/frontend/base/default/template/address/checkout/onepage/shipping.phtml
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<form action="" id="co-shipping-form">
|
28 |
+
<ul class="form-list">
|
29 |
+
<?php if ($this->customerHasAddresses()): ?>
|
30 |
+
<li class="wide">
|
31 |
+
<label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
|
32 |
+
<div class="input-box">
|
33 |
+
<?php echo $this->getAddressesHtmlSelect('shipping') ?>
|
34 |
+
</div>
|
35 |
+
</li>
|
36 |
+
<?php endif ?>
|
37 |
+
<li id="shipping-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
|
38 |
+
<fieldset>
|
39 |
+
<input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
|
40 |
+
<ul>
|
41 |
+
<li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?></li>
|
42 |
+
<li class="fields">
|
43 |
+
<div class="fields">
|
44 |
+
<label for="shipping:company"><?php echo $this->__('Company') ?></label>
|
45 |
+
<div class="input-box">
|
46 |
+
<input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" onchange="shipping.setSameAsBilling(false);" />
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</li>
|
50 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
51 |
+
<li class="wide">
|
52 |
+
<label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
53 |
+
<div class="input-box">
|
54 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
|
55 |
+
</div>
|
56 |
+
</li>
|
57 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
58 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
59 |
+
<li class="wide">
|
60 |
+
<div class="input-box">
|
61 |
+
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" onchange="shipping.setSameAsBilling(false);" />
|
62 |
+
</div>
|
63 |
+
</li>
|
64 |
+
<?php endfor; ?>
|
65 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
66 |
+
<li class="wide">
|
67 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
|
68 |
+
<div class="input-box">
|
69 |
+
<input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo $this->__('VAT Number'); ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
|
70 |
+
</div>
|
71 |
+
</li>
|
72 |
+
<?php endif; ?>
|
73 |
+
<li class="fields">
|
74 |
+
<div class="field">
|
75 |
+
<label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
76 |
+
<div class="input-box">
|
77 |
+
<?php echo $this->getCountryHtmlSelect('shipping') ?>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
<div class="field">
|
81 |
+
<label for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
82 |
+
<div class="input-box">
|
83 |
+
<select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
84 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
85 |
+
</select>
|
86 |
+
<script type="text/javascript">
|
87 |
+
//<![CDATA[
|
88 |
+
$('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
89 |
+
//]]>
|
90 |
+
</script>
|
91 |
+
<input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
</li>
|
95 |
+
<li class="fields">
|
96 |
+
<div class="field">
|
97 |
+
<label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
98 |
+
<div class="input-box">
|
99 |
+
<input type="text" title="<?php echo $this->__('City') ?>" name="shipping[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="shipping:city" onchange="shipping.setSameAsBilling(false);" />
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<div class="field">
|
104 |
+
<label for="suburb" class="required"><em>*</em><?php echo $this->__('Suburb') ?></label>
|
105 |
+
<div class="input-box">
|
106 |
+
<input type="text" name="shipping[suburb]" value="<?php echo $this->htmlEscape($this->getAddress()->getSuburb()) ?>" title="<?php echo $this->__('Suburb') ?>" id="shipping:suburb" class="input-text required-entry" />
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
</li>
|
110 |
+
<li class="fields">
|
111 |
+
<div class="field">
|
112 |
+
<label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
113 |
+
<div class="input-box">
|
114 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" onchange="shipping.setSameAsBilling(false);" />
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
|
118 |
+
</li>
|
119 |
+
<li class="fields">
|
120 |
+
<div class="field">
|
121 |
+
<label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
122 |
+
<div class="input-box">
|
123 |
+
<input type="text" name="shipping[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" />
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
+
<div class="field">
|
127 |
+
<label for="shipping:fax"><?php echo $this->__('Fax') ?></label>
|
128 |
+
<div class="input-box">
|
129 |
+
<input type="text" name="shipping[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="shipping:fax" onchange="shipping.setSameAsBilling(false);" />
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
</li>
|
133 |
+
|
134 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
135 |
+
<li class="control">
|
136 |
+
<input type="checkbox" name="shipping[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="shipping:save_in_address_book" onchange="shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
|
137 |
+
<?php else:?>
|
138 |
+
<li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
|
139 |
+
<?php endif;?>
|
140 |
+
</ul>
|
141 |
+
</fieldset>
|
142 |
+
</li>
|
143 |
+
<li class="control">
|
144 |
+
<input type="checkbox" name="shipping[same_as_billing]" id="shipping:same_as_billing" value="1"<?php if($this->getAddress()->getSameAsBilling()): ?> checked="checked"<?php endif; ?> title="<?php echo $this->__('Use Billing Address') ?>" onclick="shipping.setSameAsBilling(this.checked)" class="checkbox" /><label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label>
|
145 |
+
</li>
|
146 |
+
</ul>
|
147 |
+
<div class="buttons-set" id="shipping-buttons-container">
|
148 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
149 |
+
<p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>« </small><?php echo $this->__('Back') ?></a></p>
|
150 |
+
<button type="button" class="button" title="<?php echo $this->__('Continue') ?>" onclick="shipping.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
151 |
+
<span id="shipping-please-wait" class="please-wait" style="display:none;">
|
152 |
+
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
|
153 |
+
</span>
|
154 |
+
</div>
|
155 |
+
</form>
|
156 |
+
<script type="text/javascript">
|
157 |
+
//<![CDATA[
|
158 |
+
var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
|
159 |
+
'<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
|
160 |
+
var shippingForm = new VarienForm('co-shipping-form');
|
161 |
+
shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
|
162 |
+
//shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
|
163 |
+
$('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
|
164 |
+
|
165 |
+
var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
|
166 |
+
//]]>
|
167 |
+
</script>
|
app/design/frontend/base/default/template/address/customer/address/edit.phtml
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Edit customer address template
|
30 |
+
*
|
31 |
+
* @see Mage_Customer_Block_Address_Edit
|
32 |
+
*/
|
33 |
+
?>
|
34 |
+
<?php if($this->getTitle()): ?>
|
35 |
+
<div class="page-title">
|
36 |
+
<h1><?php echo $this->getTitle() ?></h1>
|
37 |
+
</div>
|
38 |
+
<?php endif; ?>
|
39 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
40 |
+
<form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate">
|
41 |
+
<div class="fieldset">
|
42 |
+
<?php echo $this->getBlockHtml('formkey')?>
|
43 |
+
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
|
44 |
+
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
|
45 |
+
<h2 class="legend"><?php echo $this->__('Contact Information') ?></h2>
|
46 |
+
<ul class="form-list">
|
47 |
+
<li class="fields">
|
48 |
+
<?php echo $this->getNameBlockHtml() ?>
|
49 |
+
</li>
|
50 |
+
<li class="wide">
|
51 |
+
<label for="company"><?php echo $this->__('Company') ?></label>
|
52 |
+
<div class="input-box">
|
53 |
+
<input type="text" name="company" id="company" title="<?php echo $this->__('Company') ?>" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" class="input-text" />
|
54 |
+
</div>
|
55 |
+
</li>
|
56 |
+
<li class="fields">
|
57 |
+
<div class="field">
|
58 |
+
<label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
59 |
+
<div class="input-box">
|
60 |
+
<input type="text" name="telephone" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="telephone" />
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
<div class="field">
|
64 |
+
<label for="fax"><?php echo $this->__('Fax') ?></label>
|
65 |
+
<div class="input-box">
|
66 |
+
<input type="text" name="fax" id="fax" title="<?php echo $this->__('Fax') ?>" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" class="input-text" />
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
</li>
|
70 |
+
</ul>
|
71 |
+
</div>
|
72 |
+
<div class="fieldset">
|
73 |
+
<h2 class="legend"><?php echo $this->__('Address') ?></h2>
|
74 |
+
<ul class="form-list">
|
75 |
+
<li class="wide">
|
76 |
+
<label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
|
77 |
+
<div class="input-box">
|
78 |
+
<input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
|
79 |
+
</div>
|
80 |
+
</li>
|
81 |
+
<?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
|
82 |
+
<li class="wide">
|
83 |
+
<div class="input-box">
|
84 |
+
<input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i?>" class="input-text" />
|
85 |
+
</div>
|
86 |
+
</li>
|
87 |
+
<?php endfor ?>
|
88 |
+
<li class="fields">
|
89 |
+
<div class="field">
|
90 |
+
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
91 |
+
<div class="input-box">
|
92 |
+
<?php echo $this->getCountryHtmlSelect() ?>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
<div class="field">
|
96 |
+
<label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
97 |
+
<div class="input-box">
|
98 |
+
<select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
99 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
100 |
+
</select>
|
101 |
+
<script type="text/javascript">
|
102 |
+
//<![CDATA[
|
103 |
+
$('region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
104 |
+
//]]>
|
105 |
+
</script>
|
106 |
+
<input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" />
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
</li>
|
110 |
+
<li class="fields">
|
111 |
+
<div class="field">
|
112 |
+
<label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
113 |
+
<div class="input-box">
|
114 |
+
<input type="text" name="city" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
<div class="field">
|
118 |
+
<label for="suburb" class="required"><em>*</em><?php echo $this->__('Suburb') ?></label>
|
119 |
+
<div class="input-box">
|
120 |
+
<input type="text" name="suburb" value="<?php echo $this->htmlEscape($this->getAddress()->getSuburb()) ?>" title="<?php echo $this->__('Suburb') ?>" id="suburb" class="input-text required-entry" />
|
121 |
+
</div>
|
122 |
+
</div>
|
123 |
+
</li>
|
124 |
+
<li class="fields">
|
125 |
+
<div class="field">
|
126 |
+
<label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
127 |
+
<div class="input-box">
|
128 |
+
<input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
</li>
|
133 |
+
<li<?php if($this->canSetAsDefaultBilling()) echo ' class="control"' ?>>
|
134 |
+
<?php if($this->isDefaultBilling()): ?>
|
135 |
+
<strong><?php echo $this->__('Default Billing Address') ?></strong>
|
136 |
+
<?php elseif($this->canSetAsDefaultBilling()): ?>
|
137 |
+
<input type="checkbox" id="primary_billing" name="default_billing" value="1" title="<?php echo $this->__('Use as My Default Billing Address') ?>" class="checkbox" /><label for="primary_billing"><?php echo $this->__('Use as my default billing address') ?></label>
|
138 |
+
<?php else: ?>
|
139 |
+
<input type="hidden" name="default_billing" value="1" />
|
140 |
+
<?php endif; ?>
|
141 |
+
</li>
|
142 |
+
<li<?php if($this->canSetAsDefaultShipping()) echo ' class="control"' ?>>
|
143 |
+
<?php if($this->isDefaultShipping()): ?>
|
144 |
+
<strong><?php echo $this->__('Default Shipping Address') ?></strong>
|
145 |
+
<?php elseif($this->canSetAsDefaultShipping()): ?>
|
146 |
+
<input type="checkbox" id="primary_shipping" name="default_shipping" value="1" title="<?php echo $this->__('Use as My Default Shipping Address') ?>" class="checkbox" /><label for="primary_shipping"><?php echo $this->__('Use as my default shipping address') ?></label>
|
147 |
+
<?php else: ?>
|
148 |
+
<input type="hidden" name="default_shipping" value="1" />
|
149 |
+
<?php endif; ?>
|
150 |
+
</li>
|
151 |
+
</ul>
|
152 |
+
</div>
|
153 |
+
<div class="buttons-set">
|
154 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
155 |
+
<p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>« </small><?php echo $this->__('Back') ?></a></p>
|
156 |
+
<button type="submit" title="<?php echo $this->__('Save Address') ?>" class="button"><span><span><?php echo $this->__('Save Address') ?></span></span></button>
|
157 |
+
</div>
|
158 |
+
</form>
|
159 |
+
<script type="text/javascript">
|
160 |
+
//<![CDATA[
|
161 |
+
var dataForm = new VarienForm('form-validate', true);
|
162 |
+
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
|
163 |
+
//]]>
|
164 |
+
</script>
|
app/design/frontend/base/default/template/address/persistent/checkout/onepage/billing.phtml
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
/** @var Mage_Checkout_Block_Onepage_Billing $this */
|
27 |
+
?>
|
28 |
+
<form id="co-billing-form" action="">
|
29 |
+
<fieldset>
|
30 |
+
<ul class="form-list">
|
31 |
+
<?php if ($this->customerHasAddresses()): ?>
|
32 |
+
<li class="wide">
|
33 |
+
<label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
|
34 |
+
<div class="input-box">
|
35 |
+
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
36 |
+
</div>
|
37 |
+
</li>
|
38 |
+
<?php endif; ?>
|
39 |
+
<li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
|
40 |
+
<fieldset>
|
41 |
+
<input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
|
42 |
+
<ul>
|
43 |
+
<li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
|
44 |
+
<li class="fields">
|
45 |
+
<div class="field">
|
46 |
+
<label for="billing:company"><?php echo $this->__('Company') ?></label>
|
47 |
+
<div class="input-box">
|
48 |
+
<input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
52 |
+
<div class="field">
|
53 |
+
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
54 |
+
<div class="input-box">
|
55 |
+
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
<?php endif ?>
|
59 |
+
</li>
|
60 |
+
<li class="wide">
|
61 |
+
<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
62 |
+
<div class="input-box">
|
63 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" />
|
64 |
+
</div>
|
65 |
+
</li>
|
66 |
+
<?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
|
67 |
+
<li class="wide">
|
68 |
+
<div class="input-box">
|
69 |
+
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" />
|
70 |
+
</div>
|
71 |
+
</li>
|
72 |
+
<?php endfor ?>
|
73 |
+
<li class="fields">
|
74 |
+
<div class="field">
|
75 |
+
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
76 |
+
<div class="input-box">
|
77 |
+
<input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="input-text required-entry" id="billing:city" />
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
<div class="field">
|
81 |
+
<label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
82 |
+
<div class="input-box">
|
83 |
+
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
84 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
85 |
+
</select>
|
86 |
+
<script type="text/javascript">
|
87 |
+
//<![CDATA[
|
88 |
+
$('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
89 |
+
//]]>
|
90 |
+
</script>
|
91 |
+
<input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
</li>
|
95 |
+
<li class="fields">
|
96 |
+
<div class="field">
|
97 |
+
<label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
98 |
+
<div class="input-box">
|
99 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international required-entry" />
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
<div class="field">
|
103 |
+
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
104 |
+
<div class="input-box">
|
105 |
+
<?php echo $this->getCountryHtmlSelect('billing') ?>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
</li>
|
109 |
+
<li class="fields">
|
110 |
+
<div class="field">
|
111 |
+
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
112 |
+
<div class="input-box">
|
113 |
+
<input type="text" name="billing[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="billing:telephone" />
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
<div class="field">
|
117 |
+
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
|
118 |
+
<div class="input-box">
|
119 |
+
<input type="text" name="billing[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text" id="billing:fax" />
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
</li>
|
123 |
+
<li class="fields">
|
124 |
+
<div class="field">
|
125 |
+
<label for="suburb" class="required"><em>*</em><?php echo $this->__('Suburb') ?></label>
|
126 |
+
<div class="input-box">
|
127 |
+
<input type="text" name="billing[suburb]" value="<?php echo $this->htmlEscape($this->getAddress()->getSuburb()) ?>" title="<?php echo $this->__('Suburb') ?>" id="billing:suburb" class="input-text required-entry" />
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
</li>
|
131 |
+
|
132 |
+
|
133 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
134 |
+
|
135 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
136 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
137 |
+
<?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
|
138 |
+
<li class="fields">
|
139 |
+
<?php if ($_dob->isEnabled()): ?>
|
140 |
+
<div class="field">
|
141 |
+
<?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
142 |
+
</div>
|
143 |
+
<?php endif; ?>
|
144 |
+
<?php if ($_gender->isEnabled()): ?>
|
145 |
+
<div class="field">
|
146 |
+
<?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
147 |
+
</div>
|
148 |
+
<?php endif ?>
|
149 |
+
</li>
|
150 |
+
<?php endif ?>
|
151 |
+
|
152 |
+
<?php if ($this->isTaxvatEnabled()):?>
|
153 |
+
<li><?php echo $this->getTaxvatHtml() ?></li>
|
154 |
+
<?php endif; ?>
|
155 |
+
|
156 |
+
<li class="fields" id="register-customer-password">
|
157 |
+
<div class="field">
|
158 |
+
<label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
159 |
+
<div class="input-box">
|
160 |
+
<input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
<div class="field">
|
164 |
+
<label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
165 |
+
<div class="input-box">
|
166 |
+
<input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
+
</li>
|
170 |
+
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
171 |
+
<?php endif; ?>
|
172 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
173 |
+
<li class="control">
|
174 |
+
<input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
|
175 |
+
</li>
|
176 |
+
<?php else:?>
|
177 |
+
<li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
|
178 |
+
<?php endif; ?>
|
179 |
+
</ul>
|
180 |
+
<?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
|
181 |
+
</fieldset>
|
182 |
+
</li>
|
183 |
+
<?php if ($this->canShip()): ?>
|
184 |
+
<li class="control">
|
185 |
+
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
|
186 |
+
<li class="control">
|
187 |
+
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
|
188 |
+
</li>
|
189 |
+
<?php endif; ?>
|
190 |
+
</ul>
|
191 |
+
<?php if (!$this->canShip()): ?>
|
192 |
+
<input type="hidden" name="billing[use_for_shipping]" value="1" />
|
193 |
+
<?php endif; ?>
|
194 |
+
<div class="buttons-set" id="billing-buttons-container">
|
195 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
196 |
+
<button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
197 |
+
<span class="please-wait" id="billing-please-wait" style="display:none;">
|
198 |
+
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
|
199 |
+
</span>
|
200 |
+
</div>
|
201 |
+
</fieldset>
|
202 |
+
</form>
|
203 |
+
<script type="text/javascript">
|
204 |
+
//<![CDATA[
|
205 |
+
var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
|
206 |
+
var billingForm = new VarienForm('co-billing-form');
|
207 |
+
|
208 |
+
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
|
209 |
+
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
|
210 |
+
|
211 |
+
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
|
212 |
+
Event.observe($('onepage-guest-register-button'), 'click', function(event) {
|
213 |
+
var billingRememberMe = $$('#billing-new-address-form li #remember-me-box');
|
214 |
+
if(billingRememberMe.length > 0) {
|
215 |
+
billingRememberMe = $(billingRememberMe[0].parentNode);
|
216 |
+
if ($('login:guest') && $('login:guest').checked) {
|
217 |
+
billingRememberMe.hide();
|
218 |
+
} else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
|
219 |
+
billingRememberMe.show();
|
220 |
+
}
|
221 |
+
}
|
222 |
+
})
|
223 |
+
//]]>
|
224 |
+
</script>
|
app/design/frontend/base/default/template/address/persistent/customer/form/register.phtml
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="account-create">
|
2 |
+
<div class="page-title">
|
3 |
+
<h1><?php echo $this->__('Create an Account') ?></h1>
|
4 |
+
</div>
|
5 |
+
<?php echo $this->getChildHtml('form_fields_before')?>
|
6 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
7 |
+
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
|
8 |
+
<div class="fieldset">
|
9 |
+
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
|
10 |
+
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
|
11 |
+
<h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
|
12 |
+
<ul class="form-list">
|
13 |
+
<li class="fields">
|
14 |
+
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
|
15 |
+
</li>
|
16 |
+
<li>
|
17 |
+
<label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
18 |
+
<div class="input-box">
|
19 |
+
<input type="text" name="email" id="email_address" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
20 |
+
</div>
|
21 |
+
</li>
|
22 |
+
<?php if ($this->isNewsletterEnabled()): ?>
|
23 |
+
<li class="control">
|
24 |
+
<div class="input-box">
|
25 |
+
<input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
|
26 |
+
</div>
|
27 |
+
<label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
|
28 |
+
</li>
|
29 |
+
<?php endif ?>
|
30 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
31 |
+
<?php if ($_dob->isEnabled()): ?>
|
32 |
+
<li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
|
33 |
+
<?php endif ?>
|
34 |
+
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
|
35 |
+
<?php if ($_taxvat->isEnabled()): ?>
|
36 |
+
<li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
|
37 |
+
<?php endif ?>
|
38 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
39 |
+
<?php if ($_gender->isEnabled()): ?>
|
40 |
+
<li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
|
41 |
+
<?php endif ?>
|
42 |
+
</ul>
|
43 |
+
</div>
|
44 |
+
<?php $this->setShowAddressFields(true);?>
|
45 |
+
<?php if($this->getShowAddressFields()): ?>
|
46 |
+
<div class="fieldset">
|
47 |
+
<input type="hidden" name="create_address" value="1" />
|
48 |
+
<h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
|
49 |
+
<ul class="form-list">
|
50 |
+
<li class="fields">
|
51 |
+
<div class="field">
|
52 |
+
<label for="company"><?php echo $this->__('Company') ?></label>
|
53 |
+
<div class="input-box">
|
54 |
+
<input type="text" name="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
<div class="field">
|
58 |
+
<label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
59 |
+
<div class="input-box">
|
60 |
+
<input type="text" name="telephone" id="telephone" value="<?php echo $this->htmlEscape($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" />
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
</li>
|
64 |
+
<li class="wide">
|
65 |
+
<label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
|
66 |
+
<div class="input-box">
|
67 |
+
<input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
|
68 |
+
</div>
|
69 |
+
</li>
|
70 |
+
<?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
|
71 |
+
<li class="wide">
|
72 |
+
<div class="input-box">
|
73 |
+
<input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i?>" class="input-text" />
|
74 |
+
</div>
|
75 |
+
</li>
|
76 |
+
<?php endfor ?>
|
77 |
+
<li class="fields">
|
78 |
+
<div class="field">
|
79 |
+
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
80 |
+
<div class="input-box">
|
81 |
+
<?php echo $this->getCountryHtmlSelect() ?>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
<div class="field">
|
85 |
+
<label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
86 |
+
<div class="input-box">
|
87 |
+
<select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
88 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
89 |
+
</select>
|
90 |
+
<script type="text/javascript">
|
91 |
+
//<![CDATA[
|
92 |
+
$('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
|
93 |
+
//]]>
|
94 |
+
</script>
|
95 |
+
<input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
</li>
|
99 |
+
<li class="fields">
|
100 |
+
<div class="field">
|
101 |
+
<label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
102 |
+
<div class="input-box">
|
103 |
+
<input type="text" name="city" value="<?php echo $this->htmlEscape($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
<div class="field">
|
107 |
+
<label for="suburb" class="required"><em>*</em><?php echo $this->__('Suburb') ?></label>
|
108 |
+
<div class="input-box">
|
109 |
+
<input type="text" name="suburb" value="<?php echo $this->htmlEscape($this->getFormData()->getSuburb()) ?>" title="<?php echo $this->__('Suburb') ?>" id="suburb" class="input-text required-entry" />
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
</li>
|
113 |
+
<li class="fields">
|
114 |
+
<div class="field">
|
115 |
+
<label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
116 |
+
<div class="input-box">
|
117 |
+
<input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
</li>
|
121 |
+
</ul>
|
122 |
+
<input type="hidden" name="default_billing" value="1" />
|
123 |
+
<input type="hidden" name="default_shipping" value="1" />
|
124 |
+
</div>
|
125 |
+
<?php endif; ?>
|
126 |
+
<div class="fieldset">
|
127 |
+
<h2 class="legend"><?php echo $this->__('Login Information') ?></h2>
|
128 |
+
<ul class="form-list">
|
129 |
+
<li class="fields">
|
130 |
+
<div class="field">
|
131 |
+
<label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
132 |
+
<div class="input-box">
|
133 |
+
<input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
<div class="field">
|
137 |
+
<label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
138 |
+
<div class="input-box">
|
139 |
+
<input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
</li>
|
143 |
+
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
144 |
+
</ul>
|
145 |
+
<?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
|
146 |
+
</div>
|
147 |
+
<div class="buttons-set">
|
148 |
+
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
149 |
+
<p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>« </small><?php echo $this->__('Back') ?></a></p>
|
150 |
+
<button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
|
151 |
+
</div>
|
152 |
+
<?php if (Mage::helper('checkout')->isContextCheckout()): ?>
|
153 |
+
<input name="context" type="hidden" value="checkout" />
|
154 |
+
<?php endif; ?>
|
155 |
+
</form>
|
156 |
+
<script type="text/javascript">
|
157 |
+
//<![CDATA[
|
158 |
+
var dataForm = new VarienForm('form-validate', true);
|
159 |
+
<?php if($this->getShowAddressFields()): ?>
|
160 |
+
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
|
161 |
+
<?php endif; ?>
|
162 |
+
//]]>
|
163 |
+
</script>
|
164 |
+
</div>
|
app/etc/modules/Ankit_Address.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ankit_Address>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>0.1.0</version>
|
8 |
+
</Ankit_Address>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Ankit_Address</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Add new field in register/checkout pages.</summary>
|
10 |
+
<description>It allows you add new suburb field in register and checkout section.</description>
|
11 |
+
<notes>First Preview Release</notes>
|
12 |
+
<authors><author><name>Ankit Dalal</name><user>ankitdalal</user><email>dalalankit013@gmail.com</email></author></authors>
|
13 |
+
<date>2014-10-27</date>
|
14 |
+
<time>10:23:41</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Ankit"><dir name="Address"><dir name="Block"><file name="Address.php" hash="ba72e9d737985bcffba84a7309ab564f"/></dir><dir name="Helper"><file name="Data.php" hash="286080046dd9f99f59b7e8b1cdb5797d"/></dir><dir name="etc"><file name="config.xml" hash="d7c4bb0c3b0f4f476a43b3b24db08dce"/><file name="system.xml" hash="02b8a1924b1bf53d862775ecb9982d7e"/></dir><dir name="sql"><dir name="address_setup"><file name="mysql4-install-0.1.0.php" hash="8fb941b1006f71b03926eee8db7b1fa6"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ankit_Address.xml" hash="d14fc8d266c4f53d53ed981773325f8c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="address.xml" hash="7e3e62b9b9da27336b0daa6c6f04385a"/></dir><dir name="template"><dir name="address"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="5c7d724a5f5c85d9837f2a746a316e37"/><file name="shipping.phtml" hash="e87489f6b20ef0e234a8b04b7c28abce"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="41b7ce6655b56f9a1a7b4ff2bb4cd725"/></dir></dir><dir name="persistent"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="e44c6b1afceac3d932a300df212cd831"/></dir></dir><dir name="customer"><dir name="form"><file name="register.phtml" hash="e399a02ae40eff4bb3b64b9acf089fde"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|