UK_Postcode_Address_Finder - Version 1.4.0

Version Notes

Release History :
v 1.4.0
* make error message class configurable - it can now be styled to match other Magento errors
* make error message text configurable
* fix issue with error message not being shown if hiding of address fields was enabled

v 1.3.0
* populate the company field if company name is available
* unhide all address lines on lookup error to allow customer to enter the address manually
* update to latest CraftyClicks JavaScript (v3.5):
- added the on_error event
- fixed selection of result using keyboard (got broken in latest Firefox v3.5)

v 1.2.0
* can now hide the region/province (county) field
* update to latest CraftyClicks JavaScript (v3.4)

v 1.1.2 (bug fix release)
* fix typo in JS code

v 1.1.1 (bug fix release)
* fix rearranging address fields order; was causing problems on one page checkout
* fix hiding of result box on result select
* hide result box on country change

v 1.1.0
* added Admin Panel options to configure look and feel of the module
* add address lookup to multiship checkout pages

v 1.0.0 - Initial Release

Download this release

Release Info

Developer Magento Core Team
Extension UK_Postcode_Address_Finder
Version 1.4.0
Comparing to
See all releases


Version 1.4.0

app/code/local/Dnc/Craftyclicks/Helper/Data.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Crafty Clicks
4
+ *
5
+ * @category DNC
6
+ * @package Dnc_Craftyclicks
7
+ * @copyright Tomasz Kapusta
8
+ */
9
+
10
+ include_once 'Mage/Core/Helper/Abstract.php';
11
+
12
+ class Dnc_Craftyclicks_Helper_Data extends Mage_Core_Helper_Abstract
13
+ {
14
+
15
+ }
app/code/local/Dnc/Craftyclicks/etc/config.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Crafty Clicks
5
+ *
6
+ * @category DNC
7
+ * @package Dnc_Craftyclicks
8
+ * @copyright Tomasz Kapusta
9
+ */
10
+ -->
11
+
12
+ <config>
13
+ <modules>
14
+ <Dnc_Craftyclicks>
15
+ <version>1.4.0</version>
16
+ </Dnc_Craftyclicks>
17
+ </modules>
18
+
19
+ <frontend>
20
+ <layout>
21
+ <updates>
22
+ <dnc_craftyclicks>
23
+ <file>craftyclicks.xml</file>
24
+ </dnc_craftyclicks>
25
+ </updates>
26
+ </layout>
27
+ </frontend>
28
+
29
+ <global>
30
+ <helpers>
31
+ <craftyclicks>
32
+ <class>Dnc_Craftyclicks_Helper</class>
33
+ </craftyclicks>
34
+ </helpers>
35
+ </global>
36
+
37
+ <default>
38
+ <general>
39
+ <craftyclicks>
40
+ <active>0</active>
41
+ <model>dnc/craftyclicks</model>
42
+ <access_token>xxxxx-xxxxx-xxxxx-xxxxx</access_token>
43
+ <add_elements>1</add_elements>
44
+ <button_image></button_image>
45
+ <button_class>form-button-alt</button_class>
46
+ <change_fields>1</change_fields>
47
+ <hide_fields>0</hide_fields>
48
+ <hide_county>1</hide_county>
49
+ <clear_result>0</clear_result>
50
+ <error_class>error</error_class>
51
+ <error_msg_1>This postcode could not be found, please try again or enter your address manually</error_msg_1>
52
+ <error_msg_2>This postcode is not valid, please try again or enter your address manually</error_msg_2>
53
+ <error_msg_3>Unable to connect to address lookup server, please enter your address manually</error_msg_3>
54
+ <error_msg_4>An unexpected error occured, please enter your address manually</error_msg_4>
55
+ </craftyclicks>
56
+ </general>
57
+ </default>
58
+ </config>
app/code/local/Dnc/Craftyclicks/etc/system.xml ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Crafty Clicks
5
+ *
6
+ * @category DNC
7
+ * @package Dnc_Craftyclicks
8
+ * @copyright Tomasz Kapusta
9
+ */
10
+ -->
11
+
12
+ <config>
13
+ <sections>
14
+ <general>
15
+ <groups>
16
+ <craftyclicks translate="label" module="craftyclicks">
17
+ <label>Crafty Clicks</label>
18
+ <sort_order>124</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ <fields>
23
+ <active translate="label">
24
+ <label>Enabled</label>
25
+ <frontend_type>select</frontend_type>
26
+ <source_model>adminhtml/system_config_source_yesno</source_model>
27
+ <sort_order>1</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>0</show_in_store>
31
+ </active>
32
+
33
+ <access_token translate="label">
34
+ <label>Access Token</label>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>5</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>0</show_in_store>
40
+ </access_token>
41
+
42
+ <add_elements translate="label">
43
+ <label>Generate Button and Results Box</label>
44
+ <frontend_type>select</frontend_type>
45
+ <source_model>adminhtml/system_config_source_yesno</source_model>
46
+ <sort_order>10</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>0</show_in_store>
50
+ <comment>Select to automatically create a 'Find Address' button and a results box using JavaScript DOM. This might not work on some templates. To get more control over the placing/styling you may prefer to modify your template files by hand.</comment>
51
+ </add_elements>
52
+
53
+ <button_image translate="label">
54
+ <label>Button Image</label>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>12</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>0</show_in_store>
60
+ <comment>If you set 'Generate Button and Results Box' to 'yes' here you can enter an image file name to use as the 'Find Address' button. Leave blank for a browser default button. Images shoul dbe placed in /craftclicks in you skin folder.</comment>
61
+ </button_image>
62
+
63
+ <button_class translate="label">
64
+ <label>Button Class</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>13</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>0</show_in_store>
70
+ <comment>If you set 'Generate Button and Results Box' to 'yes' here you can set the css class to use for the 'Find Address' button. Leave blank for a browser default button. Try 'form-button-alt'.</comment>
71
+ </button_class>
72
+
73
+ <change_fields translate="label">
74
+ <label>Change Address Fields Order</label>
75
+ <frontend_type>select</frontend_type>
76
+ <source_model>adminhtml/system_config_source_yesno</source_model>
77
+ <sort_order>15</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>0</show_in_store>
81
+ <comment>Select to have address fields order changed automatically (might not work on some templates). The new order: country, postcode, street, town.</comment>
82
+ </change_fields>
83
+
84
+ <hide_fields translate="label">
85
+ <label>Hide Address Fields for New Address Entry</label>
86
+ <frontend_type>select</frontend_type>
87
+ <source_model>adminhtml/system_config_source_yesno</source_model>
88
+ <sort_order>20</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>0</show_in_store>
92
+ <comment>Select to hide address fields until a postcode is looked up and an address is selected (might not work on some templates). Address fields are only hidden if they are blank (i.e. new address entry, not edit).</comment>
93
+ </hide_fields>
94
+
95
+ <hide_county translate="label">
96
+ <label>Hide County Field for UK</label>
97
+ <frontend_type>select</frontend_type>
98
+ <source_model>adminhtml/system_config_source_yesno</source_model>
99
+ <sort_order>22</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>0</show_in_store>
103
+ <comment>Select to hide the state/province (county) field if country selected is UK. County is not required to address mail in the UK, so no need to force customers to fill out this field.</comment>
104
+ </hide_county>
105
+
106
+ <clear_result translate="label">
107
+ <label>Clear Result Once Selected</label>
108
+ <frontend_type>select</frontend_type>
109
+ <source_model>adminhtml/system_config_source_yesno</source_model>
110
+ <sort_order>25</sort_order>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>0</show_in_store>
114
+ <comment>Select to hide the result box once an address is selected.</comment>
115
+ </clear_result>
116
+
117
+ <error_class translate="label">
118
+ <label>Error Msg Class</label>
119
+ <frontend_type>text</frontend_type>
120
+ <sort_order>30</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>1</show_in_website>
123
+ <show_in_store>0</show_in_store>
124
+ <comment>Set the css class to use for the error messages. Try 'error-msg', 'error' or even leave it blank.</comment>
125
+ </error_class>
126
+
127
+ <error_msg_1 translate="label">
128
+ <label>Error Msg #1</label>
129
+ <frontend_type>text</frontend_type>
130
+ <sort_order>35</sort_order>
131
+ <show_in_default>1</show_in_default>
132
+ <show_in_website>1</show_in_website>
133
+ <show_in_store>0</show_in_store>
134
+ <comment>This message is shown if the postcode is in valid format, but not found int he database'.</comment>
135
+ </error_msg_1>
136
+
137
+ <error_msg_2 translate="label">
138
+ <label>Error Msg #2</label>
139
+ <frontend_type>text</frontend_type>
140
+ <sort_order>37</sort_order>
141
+ <show_in_default>1</show_in_default>
142
+ <show_in_website>1</show_in_website>
143
+ <show_in_store>0</show_in_store>
144
+ <comment>This message is shown if the postcode format is not valid'.</comment>
145
+ </error_msg_2>
146
+
147
+ <error_msg_3 translate="label">
148
+ <label>Error Msg #3</label>
149
+ <frontend_type>text</frontend_type>
150
+ <sort_order>39</sort_order>
151
+ <show_in_default>1</show_in_default>
152
+ <show_in_website>1</show_in_website>
153
+ <show_in_store>0</show_in_store>
154
+ <comment>This message is shown if the connection to lookup server times out'.</comment>
155
+ </error_msg_3>
156
+
157
+ <error_msg_4 translate="label">
158
+ <label>Error Msg #4</label>
159
+ <frontend_type>text</frontend_type>
160
+ <sort_order>41</sort_order>
161
+ <show_in_default>1</show_in_default>
162
+ <show_in_website>1</show_in_website>
163
+ <show_in_store>0</show_in_store>
164
+ <comment>This message is shown if any other error occurs'.</comment>
165
+ </error_msg_4>
166
+
167
+ <help_label translate="label">
168
+ <label>Problems?</label>
169
+ <frontend_type>label</frontend_type>
170
+ <sort_order>50</sort_order>
171
+ <show_in_default>1</show_in_default>
172
+ <show_in_website>1</show_in_website>
173
+ <show_in_store>0</show_in_store>
174
+ <comment>Look on the module magento connect page, or email support@craftyclicks.co.uk.</comment>
175
+ </help_label>
176
+ </fields>
177
+ <comment><![CDATA[<a href="http://www.craftyclicks.co.uk" target="_blank">Signup for your free CraftyClicks evaluation account</a>]]></comment>
178
+ </craftyclicks>
179
+ </groups>
180
+ </general>
181
+ </sections>
182
+ </config>
app/design/frontend/default/default/layout/craftyclicks.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout>
4
+
5
+ <checkout_onepage_index>
6
+ <reference name="checkout.onepage.billing">
7
+ <action method="setTemplate"><template>dnc/craftyclicks/checkout/onepage/billing.phtml</template></action>
8
+ </reference>
9
+ <reference name="checkout.onepage.shipping">
10
+ <action method="setTemplate"><template>dnc/craftyclicks/checkout/onepage/shipping.phtml</template></action>
11
+ </reference>
12
+ <reference name="content">
13
+ <block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="dnc/craftyclicks/checkout_onepage.phtml"/>
14
+ </reference>
15
+ </checkout_onepage_index>
16
+
17
+ <checkout_multishipping_customer_address>
18
+ <reference name="customer_address_edit">
19
+ <action method="setTemplate"><template>dnc/craftyclicks/customer/address/edit.phtml</template></action>
20
+ </reference>
21
+ <reference name="content">
22
+ <block type="customer/address_edit" name="customer.address.edit" as="shipping" template="dnc/craftyclicks/address_form.phtml"/>
23
+ </reference>
24
+ </checkout_multishipping_customer_address>
25
+
26
+ <customer_address_form>
27
+ <reference name="customer_address_edit">
28
+ <action method="setTemplate"><template>dnc/craftyclicks/customer/address/edit.phtml</template></action>
29
+ </reference>
30
+ <reference name="content">
31
+ <block type="customer/address_edit" name="customer.address.edit" template="dnc/craftyclicks/address_form.phtml"/>
32
+ </reference>
33
+ </customer_address_form>
34
+
35
+ </layout>
app/design/frontend/default/default/template/dnc/craftyclicks/address_form.phtml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ require ('crafty_template_helper.php');
3
+
4
+ crafty_add_address_finder($this, '', 'company', 'street_', 'city', 'region', 'zip', 'country');
5
+ ?>
app/design/frontend/default/default/template/dnc/craftyclicks/checkout/onepage/billing.phtml ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_default
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="co-billing-form" action="">
28
+ <?php if ($this->customerHasAddresses()): ?>
29
+ <p><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></p>
30
+ <ul><li><p><?php echo $this->getAddressesHtmlSelect('billing') ?></p></li></ul>
31
+
32
+ <?php endif ?>
33
+ <fieldset class="group-select" id="billing-new-address-form" <?php if ($this->customerHasAddresses()): ?>style="display:none"<?php endif ?>>
34
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
35
+ <ul>
36
+ <li><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())
37
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
38
+ <li>
39
+ <?php if (1 != Mage::getStoreConfig('general/craftyclicks/active') ||
40
+ 1 != Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
41
+ <div class="input-box">
42
+ <label for="billing:company"><?php echo $this->__('Company') ?></label><br />
43
+ <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" /></div>
44
+ <?php endif ?>
45
+ <?php if(!$this->isCustomerLoggedIn()): ?>
46
+ <div class="input-box">
47
+ <label for="billing:email"><?php echo $this->__('Email Address') ?> <span class="required">*</span></label><br />
48
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="validate-email required-entry input-text" /></div>
49
+ <?php endif ?>
50
+ </li>
51
+ <?php if (1 == Mage::getStoreConfig('general/craftyclicks/active') &&
52
+ 1 == Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
53
+ <li><div class="input-box">
54
+ <label for="billing:country_id"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
55
+ <?php echo $this->getCountryHtmlSelect('billing') ?></div>
56
+ <div class="input-box">
57
+ <label for="billing:postcode"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br />
58
+ <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="validate-zip-international required-entry input-text" /></div>
59
+ </li>
60
+ <li>
61
+ <div class="input-box">
62
+ <label for="billing:company"><?php echo $this->__('Company') ?></label><br />
63
+ <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" /></div>
64
+ </li>
65
+ <?php endif ?>
66
+ <li><label for="billing:street1"><?php echo $this->__('Address') ?> <span class="required">*</span></label><br />
67
+ <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="required-entry input-text" /></li>
68
+ <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
69
+ <li><input type="text" title="<?php echo $this->__('Street Address '.$_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" /></li>
70
+ <?php endfor ?>
71
+ <li><div class="input-box">
72
+ <label for="billing:city"><?php echo $this->__('City') ?> <span class="required">*</span></label><br />
73
+ <input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="required-entry input-text" id="billing:city" /></div>
74
+ <div class="input-box">
75
+ <label for="billing:region"><?php echo $this->__('State/Province') ?> <span class="required">*</span></label><br/>
76
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none">
77
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
78
+ </select>
79
+ <script type="text/javascript">
80
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
81
+ </script>
82
+ <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" />
83
+ </div></li>
84
+ <?php if (1 != Mage::getStoreConfig('general/craftyclicks/active') ||
85
+ 1 != Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
86
+ <li><div class="input-box">
87
+ <label for="billing:postcode"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br />
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="validate-zip-international required-entry input-text" /></div>
89
+ <div class="input-box">
90
+ <label for="billing:country_id"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
91
+ <?php echo $this->getCountryHtmlSelect('billing') ?></div></li>
92
+ <?php endif ?>
93
+ <li><div class="input-box">
94
+ <label for="billing:telephone"><?php echo $this->__('Telephone') ?> <span class="required">*</span></label><br/>
95
+ <input type="text" name="billing[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="required-entry input-text" id="billing:telephone" /></div>
96
+ <div class="input-box">
97
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label><br/>
98
+ <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" /></div></li>
99
+ <?php if(!$this->isCustomerLoggedIn()): ?>
100
+
101
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
102
+ <?php if ($_dob->isEnabled()): ?>
103
+ <li>
104
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())
105
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
106
+ </li>
107
+ <?php endif ?>
108
+
109
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
110
+ <?php if ($_taxvat->isEnabled()): ?>
111
+ <li>
112
+ <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())
113
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
114
+ </li>
115
+ <?php endif ?>
116
+
117
+ <li id="register-customer-password">
118
+ <div class="input-box">
119
+ <label for="billing:customer_password"><?php echo $this->__('Password') ?> <span class="required">*</span></label><br/>
120
+ <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="required-entry validate-password input-text" /></div>
121
+ <div class="input-box">
122
+ <label for="billing:confirm_password"><?php echo $this->__('Confirm Password') ?> <span class="required">*</span></label><br/>
123
+ <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="required-entry validate-password input-text" /></div></li>
124
+ <?php endif ?>
125
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
126
+ <li><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="shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> /> <label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
127
+ <?php else:?>
128
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
129
+ <?php endif;?>
130
+ </ul>
131
+ </fieldset>
132
+ <fieldset>
133
+ <?php if ($this->canShip()): ?>
134
+ <p>
135
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" <?php if ($this->isUseBillingAddressForShipping()) {?>checked="checked" <?php }?>onclick="$('shipping:same_as_billing').checked = true;" />&nbsp;<label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0" <?php if (!$this->isUseBillingAddressForShipping()) {?>checked="checked" <?php }?>onclick="$('shipping:same_as_billing').checked = false;" />&nbsp;<label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
136
+ </p>
137
+ <?php else: ?>
138
+ <p class="no-display"><input type="hidden" name="billing[use_for_shipping]" value="1" /></p>
139
+ <?php endif; ?>
140
+ </fieldset>
141
+ </form>
142
+ <div class="button-set">
143
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
144
+ <div id="billing-buttons-container">
145
+ <button type="button" class="form-button right" onclick="billing.save()"><span><?php echo $this->__('Continue') ?></span></button>
146
+ <span id="billing-please-wait" style="display:none;" class="opc-please-wait">
147
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt="" /> &nbsp; <?php echo $this->__('Loading next step...') ?> &nbsp;
148
+ </span>
149
+ </div>
150
+ </div>
151
+
152
+ <script type="text/javascript">
153
+ //<![CDATA[
154
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
155
+ var billingForm = new VarienForm('co-billing-form');
156
+
157
+ //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
158
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
159
+
160
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions);
161
+ //]]>
162
+ </script>
app/design/frontend/default/default/template/dnc/craftyclicks/checkout/onepage/shipping.phtml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_default
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="co-shipping-form" action="">
28
+ <?php if ($this->customerHasAddresses()): ?>
29
+ <p><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></p>
30
+ <p><?php echo $this->getAddressesHtmlSelect('shipping') ?></p>
31
+ <?php endif ?>
32
+
33
+ <fieldset class="group-select" id="shipping-new-address-form" <?php if ($this->customerHasAddresses()): ?>style="display:none"<?php endif ?>>
34
+ <input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
35
+ <ul>
36
+ <li><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())
37
+ ->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->setFieldParams('onchange="shipping.setSameAsBilling(false)"')->toHtml() ?></li>
38
+ <?php if (1 != Mage::getStoreConfig('general/craftyclicks/active') ||
39
+ 1 != Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
40
+ <li><div class="input-box">
41
+ <label for="shipping:company"><?php echo $this->__('Company') ?></label><br/>
42
+ <input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" onchange="shipping.setSameAsBilling(false);" /></div>
43
+ <?php if(false): ?>
44
+ <div class="input-box">
45
+ <label for="shipping:email"><?php echo $this->__('Email Address') ?> <span class="required">*</span></label><br />
46
+ <input type="text" name="shipping[email]" id="shipping:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="validate-email required-entry input-text" /></div>
47
+ <?php endif ?>
48
+ </li>
49
+ <?php endif ?>
50
+ <?php if (1 == Mage::getStoreConfig('general/craftyclicks/active') &&
51
+ 1 == Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
52
+ <li><div class="input-box">
53
+ <label for="shipping:country_id"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
54
+ <?php echo $this->getCountryHtmlSelect('shipping') ?></div>
55
+ <div class="input-box">
56
+ <label for="shipping:postcode"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br />
57
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="validate-zip-international required-entry input-text" onchange="shipping.setSameAsBilling(false);"/></div>
58
+ </li>
59
+ <li><div class="input-box">
60
+ <label for="shipping:company"><?php echo $this->__('Company') ?></label><br/>
61
+ <input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" onchange="shipping.setSameAsBilling(false);" /></div>
62
+ </li>
63
+ <?php endif ?>
64
+ <li><label for="shipping:street1"><?php echo $this->__('Address') ?> <span class="required">*</span></label><br />
65
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="required-entry input-text" onchange="shipping.setSameAsBilling(false);" /></li>
66
+ <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
67
+ <li><input type="text" title="<?php echo $this->__('Street Address '.$_i) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" onchange="shipping.setSameAsBilling(false);"/></li>
68
+ <?php endfor ?>
69
+ <li><div class="input-box">
70
+ <label for="shipping:city"><?php echo $this->__('City') ?> <span class="required">*</span></label><br />
71
+ <input type="text" title="<?php echo $this->__('City') ?>" name="shipping[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="required-entry input-text" id="shipping:city" onchange="shipping.setSameAsBilling(false);" /></div>
72
+ <div class="input-box">
73
+ <label for="shipping:region_id"><?php echo $this->__('State/Province') ?> <span class="required">*</span></label><br />
74
+ <select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none">
75
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
76
+ </select>
77
+ <script type="text/javascript">
78
+ $('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
79
+ </script>
80
+ <input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none" /></div></li>
81
+ <?php if (1 != Mage::getStoreConfig('general/craftyclicks/active') ||
82
+ 1 != Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
83
+ <li><div class="input-box">
84
+ <label for="shipping:postcode"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br />
85
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="validate-zip-international required-entry input-text" onchange="shipping.setSameAsBilling(false);"/></div>
86
+ <div class="input-box">
87
+ <label for="shipping:country_id"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
88
+ <?php echo $this->getCountryHtmlSelect('shipping') ?>
89
+ </div></li>
90
+ <?php endif ?>
91
+ <li><div class="input-box">
92
+ <label for="shipping:telephone"><?php echo $this->__('Telephone') ?> <span class="required">*</span></label><br />
93
+ <input type="text" name="shipping[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="required-entry input-text" id="shipping:telephone" onchange="shipping.setSameAsBilling(false);" /></div>
94
+ <div class="input-box">
95
+ <label for="shipping:fax"><?php echo $this->__('Fax') ?></label><br />
96
+ <input type="text" name="shipping[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text" id="shipping:fax" onchange="shipping.setSameAsBilling(false);" /></div></li>
97
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
98
+ <li><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;?> /> <label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
99
+ <?php else:?>
100
+ <li><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>
101
+ <?php endif;?>
102
+ </ul>
103
+ </fieldset>
104
+ <p><input type="checkbox" name="shipping[same_as_billing]" id="shipping:same_as_billing" value="1" <?php if($this->getAddress()->getSameAsBilling()): ?>checked="checked"<?php endif ?> onclick="shipping.setSameAsBilling(this.checked)" /> &nbsp;<label for="shipping:same_as_billing"><?php echo $this->__('Use Billing Address') ?></label></p>
105
+ </form>
106
+ <div class="button-set">
107
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
108
+ <div id="shipping-buttons-container">
109
+ <a href="#" class="back left" onclick="checkout.back(); return false;"><?php echo $this->__('Back') ?></a>
110
+ <button type="button" class="form-button right" onclick="shipping.save()"><span><?php echo $this->__('Continue') ?></span></button>
111
+ <span id="shipping-please-wait" style="display:none;" class="opc-please-wait">
112
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" class="v-middle" alt="" /> &nbsp; <?php echo $this->__('Loading next step...') ?> &nbsp;
113
+ </span>
114
+ </div>
115
+ </div>
116
+
117
+ <script type="text/javascript">
118
+ //<![CDATA[
119
+ var shipping = new Shipping('co-shipping-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveShipping') ?>',
120
+ '<?php echo $this->getUrl('checkout/onepage/shippingMethod') ?>');
121
+ var shippingForm = new VarienForm('co-shipping-form');
122
+ shippingForm.extraChildParams = ' onchange="shipping.setSameAsBilling(false);"';
123
+ //shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
124
+ $('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);
125
+
126
+ var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', countryRegions);
127
+ //]]>
128
+ </script>
app/design/frontend/default/default/template/dnc/craftyclicks/checkout_onepage.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ require ('crafty_template_helper.php');
3
+
4
+ crafty_add_address_finder($this, '', 'billing:company', 'billing:street', 'billing:city', 'billing:region', 'billing:postcode', 'billing:country_id');
5
+ crafty_add_address_finder($this, '2', 'shipping:company', 'shipping:street', 'shipping:city', 'shipping:region', 'shipping:postcode', 'shipping:country_id');
6
+ ?>
app/design/frontend/default/default/template/dnc/craftyclicks/crafty_template_helper.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $crafty_script_added = false;
3
+ function crafty_add_address_finder($obj, $suffix = '', $company_id = 'company', $street_id = 'street_', $town_id='city', $county_id='region', $postcode_id = 'zip', $country_id = '_cp_country') {
4
+ global $crafty_script_added;
5
+ $conf = Mage::getStoreConfig('general');
6
+
7
+ if (1 == $conf['craftyclicks']['active']) {
8
+
9
+ if (false == $crafty_script_added) {
10
+ echo "<script type=\"text/javascript\" charset=\"ISO-8859-1\" src=\"".$obj->getJsUrl('crafty/crafty_postcode.js')."\"></script>\n";
11
+ $crafty_script_added = true;
12
+ }
13
+
14
+ echo "<script type=\"text/javascript\">";
15
+
16
+ if (1 == $conf['craftyclicks']['add_elements']) {
17
+ // need to create the 'find address button and the results box
18
+ $button_class = '';
19
+ if (array_key_exists('button_class',$conf['craftyclicks']) && '' != $conf['craftyclicks']['button_class']) {
20
+ $button_class = 'class="'.$conf['craftyclicks']['button_class'].'" ';
21
+ }
22
+ if (!array_key_exists('button_image',$conf['craftyclicks']) || '' == $conf['craftyclicks']['button_image']) {
23
+ // default browser button
24
+ $buttonHTML = "<span id=\"findAddrBtn".$suffix."\">&nbsp;&nbsp;<button type=\"button\" onclick=\"_cp_do_lookup".$suffix."()\" ".$button_class.">Find Address</button></span>";
25
+ } else {
26
+ $buttonHTML = "<span id=\"findAddrBtn".$suffix."\">&nbsp;&nbsp;<img style=\"cursor: pointer;\" src=\"".$obj->getSkinUrl('craftyclicks/'.$conf['craftyclicks']['button_image'])."\" onclick=\"_cp_do_lookup".$suffix."()\" title=\"Find Address\" ".$button_class."/></span>";
27
+ }
28
+
29
+ $resultHTML = "<div style=\"display:block; clear:both;\" id=\"crafty_postcode_result_display".$suffix."\">&nbsp;</div>";
30
+ echo "
31
+ var _cp_postcodeHTML = document.getElementById('".$postcode_id."').parentNode.innerHTML;
32
+ document.getElementById('".$postcode_id."').parentNode.innerHTML = _cp_postcodeHTML+'".$buttonHTML."';
33
+ var _cp_liHTML = document.getElementById('".$postcode_id."').parentNode.parentNode.innerHTML;
34
+ document.getElementById('".$postcode_id."').parentNode.parentNode.innerHTML = _cp_liHTML+'".$resultHTML."';
35
+ ";
36
+ }
37
+
38
+ if (1 == $conf['craftyclicks']['hide_fields'] && '' == $obj->getAddress()->getPostcode()) {
39
+ // hide address fields if they are blank, only show them once an address is selected
40
+ echo "
41
+ function _cp_set_addr_fields_display".$suffix."(new_display) {
42
+ document.getElementById('".$town_id."').parentNode.parentNode.style.display = new_display;
43
+ if (document.getElementById('".$company_id."')) {
44
+ document.getElementById('".$company_id."').parentNode.style.display = new_display;
45
+ }";
46
+ // do all street lines
47
+ for ($street_num = 1; $street_num<=$obj->helper('customer/address')->getStreetLines(); $street_num++) {
48
+ echo "
49
+ document.getElementById('".$street_id.$street_num."').parentNode.style.display = new_display;";
50
+ }
51
+ echo "
52
+ }
53
+ // hide all address lines
54
+ _cp_set_addr_fields_display".$suffix."('none');
55
+
56
+ function _cp_addr_fields_show".$suffix."() {
57
+ _cp_set_addr_fields_display".$suffix."('block');
58
+ }
59
+ ";
60
+ } else {
61
+ echo "
62
+ function _cp_addr_fields_show".$suffix."() {
63
+ // stub
64
+ }
65
+ ";
66
+ }
67
+ if (1 == $conf['craftyclicks']['clear_result']) {
68
+ echo "
69
+ function _cp_addr_result_hide".$suffix."() {
70
+ cp_obj".$suffix.".update_res(null);
71
+ }
72
+ ";
73
+ } else {
74
+ echo "
75
+ function _cp_addr_result_hide".$suffix."() {
76
+ //STUB
77
+ }
78
+ ";
79
+ }
80
+
81
+ if (1 == $conf['craftyclicks']['hide_county']) {
82
+ echo "
83
+ function _cp_county_display".$suffix."(new_display) {
84
+ var county_filed = document.getElementById('".$county_id."').parentNode;
85
+ if (county_filed) {
86
+ county_filed.style.display = new_display;
87
+ }
88
+ }
89
+ ";
90
+ } else {
91
+ echo "
92
+ function _cp_county_display".$suffix."(dummy) {
93
+ //STUB
94
+ }
95
+ ";
96
+ }
97
+
98
+ echo "
99
+ function _cp_result_ready".$suffix."() {
100
+ _cp_addr_fields_show".$suffix."();
101
+ _cp_addr_result_hide".$suffix."();
102
+ }
103
+ function _cp_result_error".$suffix."() {
104
+ _cp_addr_fields_show".$suffix."();";
105
+
106
+ if (array_key_exists('error_class',$conf['craftyclicks']) && '' != $conf['craftyclicks']['error_class']) {
107
+ echo " document.getElementById('crafty_postcode_result_display".$suffix."').className = '".$conf['craftyclicks']['error_class']."';";
108
+ }
109
+ echo " }
110
+ function _cp_country_handler".$suffix."() {
111
+ if ('GB' != document.getElementById('".$country_id."').value) {
112
+ document.getElementById('".$postcode_id."').style.width = _cp_oldZipWidth".$suffix.";
113
+ document.getElementById('findAddrBtn".$suffix."').style.display = 'none';
114
+ _cp_result_ready".$suffix."();
115
+ cp_obj".$suffix.".update_res(null);
116
+ _cp_county_display".$suffix."('inline');
117
+ } else {
118
+ document.getElementById('".$postcode_id."').style.width = '80px';
119
+ document.getElementById('findAddrBtn".$suffix."').style.display = 'inline';
120
+ _cp_county_display".$suffix."('none');
121
+ }
122
+ }
123
+ function _cp_do_lookup".$suffix."()
124
+ {
125
+ document.getElementById('crafty_postcode_result_display".$suffix."').className = '';
126
+ cp_obj".$suffix.".doLookup();
127
+ }
128
+
129
+ var _cp_oldZipWidth".$suffix." = document.getElementById('". $postcode_id."').style.width;
130
+ var _cp_countryElem".$suffix." = document.getElementById('".$country_id."');
131
+ _cp_countryElem".$suffix.".onchange = _cp_country_handler".$suffix.";
132
+ _cp_countryElem".$suffix.".onclick = _cp_country_handler".$suffix.";
133
+ _cp_countryElem".$suffix.".onkeypress = _cp_country_handler".$suffix.";
134
+
135
+ _cp_country_handler".$suffix."();
136
+
137
+ var cp_obj".$suffix." = CraftyPostcodeCreate();
138
+ cp_obj".$suffix.".set('max_width', '530px');
139
+ cp_obj".$suffix.".set('access_token', '".$conf['craftyclicks']['access_token']."');
140
+ cp_obj".$suffix.".set('result_elem_id', 'crafty_postcode_result_display".$suffix."');
141
+ cp_obj".$suffix.".set('form', '');";
142
+
143
+ $element_ids = $company_id.',';
144
+ for ($streetNum = 1; $streetNum<=3; $streetNum++) {
145
+ if ($streetNum<=$obj->helper('customer/address')->getStreetLines()) {
146
+ $element_ids.= $street_id.$streetNum.',';
147
+ } else {
148
+ $element_ids.= ',';
149
+ }
150
+ }
151
+ $element_ids.=$town_id.','.$county_id.','.$postcode_id;
152
+
153
+ echo "
154
+ cp_obj".$suffix.".set('elements', '".$element_ids."');
155
+ cp_obj".$suffix.".set('first_res_line', '----- please select your address ----');
156
+ cp_obj".$suffix.".set('res_autoselect', '0');
157
+ cp_obj".$suffix.".set('busy_img_url', '".$obj->getSkinUrl('craftyclicks/crafty_postcode_busy.gif')."');
158
+ cp_obj".$suffix.".set('res_select_on_change', '0');
159
+ cp_obj".$suffix.".set('on_result_selected', _cp_result_ready".$suffix.");
160
+ cp_obj".$suffix.".set('on_error', _cp_result_error".$suffix.");";
161
+ if (array_key_exists('error_msg_1',$conf['craftyclicks']) && '' != $conf['craftyclicks']['error_msg_1']) {
162
+ echo " cp_obj".$suffix.".set('err_msg1', '".$conf['craftyclicks']['error_msg_1']."');";
163
+ }
164
+ if (array_key_exists('error_msg_2',$conf['craftyclicks']) && '' != $conf['craftyclicks']['error_msg_2']) {
165
+ echo " cp_obj".$suffix.".set('err_msg2', '".$conf['craftyclicks']['error_msg_2']."');";
166
+ }
167
+ if (array_key_exists('error_msg_3',$conf['craftyclicks']) && '' != $conf['craftyclicks']['error_msg_3']) {
168
+ echo " cp_obj".$suffix.".set('err_msg3', '".$conf['craftyclicks']['error_msg_3']."');";
169
+ }
170
+ if (array_key_exists('error_msg_4',$conf['craftyclicks']) && '' != $conf['craftyclicks']['error_msg_4']) {
171
+ echo " cp_obj".$suffix.".set('err_msg4', '".$conf['craftyclicks']['error_msg_4']."');";
172
+ }
173
+ echo "
174
+ </script>";
175
+ }
176
+ }
177
+ ?>
app/design/frontend/default/default/template/dnc/craftyclicks/customer/address/edit.phtml ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_default
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.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-head">
36
+ <h3><?php echo $this->getTitle() ?></h3>
37
+ </div>
38
+ <?php endif; ?>
39
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
40
+ <form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate">
41
+ <fieldset class="group-select">
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
+ <h4 class="legend"><?php echo $this->__('Contact Information') ?></h4>
46
+ <ul>
47
+ <li>
48
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getCustomer())->toHtml() ?>
49
+ </li>
50
+ <?php if (1 != Mage::getStoreConfig('general/craftyclicks/active') ||
51
+ 1 != Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
52
+ <li>
53
+ <label for="company"><?php echo $this->__('Company') ?></label><br />
54
+ <input type="text" name="company" id="company" title="<?php echo $this->__('Company') ?>" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" class="input-text" />
55
+ </li>
56
+ <?php endif ?>
57
+ <li>
58
+ <div class="input-box">
59
+ <label for="telephone"><?php echo $this->__('Telephone') ?> <span class="required">*</span></label><br />
60
+ <input type="text" name="telephone" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="required-entry input-text" id="telephone" />
61
+ </div>
62
+ <div class="input-box">
63
+ <label for="fax"><?php echo $this->__('Fax') ?></label><br />
64
+ <input type="text" name="fax" id="fax" title="<?php echo $this->__('Fax') ?>" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" class="input-text" />
65
+ </div>
66
+ </li>
67
+ </ul>
68
+ </fieldset>
69
+ <fieldset class="group-select">
70
+ <h4 class="legend"><?php echo $this->__('Address') ?></h4>
71
+ <ul>
72
+ <?php if (1 == Mage::getStoreConfig('general/craftyclicks/active') &&
73
+ 1 == Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
74
+ <li>
75
+ <div class="input-box">
76
+ <label for="country"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
77
+ <?php echo $this->getCountryHtmlSelect() ?>
78
+ </div>
79
+ <div class="input-box">
80
+ <label for="zip"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br />
81
+ <input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="validate-zip-international required-entry input-text" />
82
+ </div>
83
+ </li>
84
+ <li>
85
+ <label for="company"><?php echo $this->__('Company') ?></label><br />
86
+ <input type="text" name="company" id="company" title="<?php echo $this->__('Company') ?>" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" class="input-text" />
87
+ </li>
88
+ <?php endif ?>
89
+ <li>
90
+ <label for="street_1"><?php echo $this->__('Street Address') ?> <span class="required">*</span></label><br />
91
+ <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="required-entry input-text" />
92
+ </li>
93
+ <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
94
+ <li>
95
+ <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address '.$_i) ?>" id="street_<?php echo $_i?>" class="input-text" />
96
+ </li>
97
+ <?php endfor ?>
98
+ <li>
99
+ <div class="input-box">
100
+ <label for="city"><?php echo $this->__('City') ?> <span class="required">*</span></label><br />
101
+ <input type="text" name="city" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="required-entry input-text" id="city" />
102
+ </div>
103
+ <div class="input-box">
104
+ <label for="region_id"><?php echo $this->__('State/Province') ?> <span class="required">*</span></label><br />
105
+ <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none">
106
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
107
+ </select>
108
+ <script type="text/javascript">
109
+ $('region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
110
+ </script>
111
+ <input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none" />
112
+ </div>
113
+ </li>
114
+ <?php if (1 != Mage::getStoreConfig('general/craftyclicks/active') ||
115
+ 1 != Mage::getStoreConfig('general/craftyclicks/change_fields')) : ?>
116
+ <li>
117
+ <div class="input-box">
118
+ <label for="zip"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br />
119
+ <input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="validate-zip-international required-entry input-text" />
120
+ </div>
121
+ <div class="input-box">
122
+ <label for="country"><?php echo $this->__('Country') ?> <span class="required">*</span></label><br />
123
+ <?php echo $this->getCountryHtmlSelect() ?>
124
+ </div>
125
+ </li>
126
+ <?php endif ?>
127
+ <li>
128
+ <?php if($this->isDefaultBilling()): ?>
129
+ <strong><?php echo $this->__('Default Billing Address') ?></strong>
130
+ <?php elseif($this->canSetAsDefaultBilling()): ?>
131
+ <input type="checkbox" id="primary_billing" name="default_billing" value="1" />&nbsp;
132
+ <label for="primary_billing"><?php echo $this->__('Use as my default billing address') ?></label>
133
+ <?php else: ?>
134
+ <input type="hidden" name="default_billing" value="1" />
135
+ <?php endif; ?>
136
+ </li>
137
+ <li>
138
+ <?php if($this->isDefaultShipping()): ?>
139
+ <strong><?php echo $this->__('Default Shipping Address') ?></strong>
140
+ <?php elseif($this->canSetAsDefaultShipping()): ?>
141
+ <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" />&nbsp;
142
+ <label for="primary_shipping"><?php echo $this->__('Use as my default shipping address') ?></label>
143
+ <?php else: ?>
144
+ <input type="hidden" name="default_shipping" value="1" />
145
+ <?php endif; ?>
146
+ </li>
147
+ </ul>
148
+ </fieldset>
149
+ <div class="button-set">
150
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
151
+ <a href="<?php echo $this->getBackUrl() ?>" class="left">&laquo; <?php echo $this->__('Back') ?></a>
152
+ <button class="form-button" type="submit"><span><?php echo $this->__('Save Address') ?></span></button>
153
+ </div>
154
+ </form>
155
+ <script type="text/javascript">
156
+ var dataForm = new VarienForm('form-validate', true);
157
+ new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>);
158
+ </script>
app/etc/modules/Dnc_Craftyclicks.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Dnc_Craftyclicks>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <version>1.4.0</version>
8
+ </Dnc_Craftyclicks>
9
+ </modules>
10
+ </config>
js/crafty/crafty_postcode.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Compression by ScriptingMagic.com
2
+ /********************************************************************************
3
+ // This is a collection of JavaScript code to allow easy integration of
4
+ // postcode lookup functionality into any website
5
+ //
6
+ // Provided by www.CraftyClicks.co.uk
7
+ //
8
+ // Version - 3.5 (05/10/2009)
9
+ //
10
+ // Feel free to copy/use/modify this code any way you see fit. Please keep this
11
+ // comment header in place when you do.
12
+ //
13
+ // To integrate UK postcode lookup on your website, please visit www.craftyclicks.co.uk for
14
+ // details of how to sign up for an account.
15
+ //
16
+ // Compacted by ScriptingMagic.com to speed up load time, if you want the full version, please email us.
17
+ **********************************************************************************/
18
+ eval((function(){var a="s�@��reate(@++;�=new�J��.obj@=@;�}�=�; _cp��Are(a,bc�d;�3a[�&&�3���a[��(5,a[�2�����(5,�2)��a[������c>d�:1�c<d�:-1�a[�>��:1�(-1� �(e!ee=window.ev}�c���/c��/}}c�=13��(�}�J�4={�urlzpcls1.crafty�s.co.uk/�js.php�ac�C_tokenz�traditi�al_��&�z%p_busy.gif���&org#�@#:1,�#�&addr#�&�:� �msg1zPle� wait w�e we find the�=��1�could not be foun�2�is not vali�3zUnable to c�nect to�= lookup server��4zAn unexpected error occured�_auto�@�@ �&�:10000,formz�e�sz%��Any��1��2��3����,%in_�_p��z400px���&�_�z��Iz��_�ready:�,�M:�,�:�};xmlhttp��=�;����@�cc��5�clean_pc���obj_name�set��4[a]=b};�5�ed�cc++;�5�(a)�7�&&((2>=�&&1<cc)||(2<�))�(��c�0}}};�5���10==a0a--}}b���;�Di�i<6;i++i]=get_e�(i�a=��[a][in�x����[a];0]0d[org�}e=d[�1��f=d[�2��g=f+(f=�e�h=��j=`�;qg&&�g)==gqhh�hj�j}g�e=}k=h+(h=�j�l=�0;�&&3]q7||!=�9�}kf�e��f�e�Gg��g�k}�Gghj�#h�j��Gkfe�#�E�Gfe;�h�Ejg<kg�h�j��E�F}��9�l&&!=gkqff�e�g�}�g�k�Gg&&!=�kk�g(+g)<(g+k)+c+g�k��g+c+�Fm;1]m=1]2]m=2]m=3]}}q7m�7+c+km�+(=��0}}}4]4`��}5]5`��}�M�M(a�1};show_busy=(a=�8img��Bsrc�b����Btitle�b�msg1��(a�;�_err���;qad�0001�10002�29001�3�;�fault:�(+a+) +�4�}� e�8000�No Ac�C Token �1�Format �2��3�Out of Credits �}d+=e+ :: DBG :: +b}��d��(c�d�};�_��b=�;qab=�a��(b�a�};�lay_���=�(���!=���~c)���8�d.i��;d.����ed��d.�keyps=�;�7�d.�change����d.style.width=��e=�@;�1e++}e>=��-��-e}d~c��(d�};���clearTime�(��try{�b=�(�I�b.hasC�dNo�s()w�e�%b.removeC�d�%�}�==aa=�xa0�b~a�}catch(er}};�=(sl�r=s-1;w�e(l<s&&s[l�,l++}w�e(r>l&&s[r�,r-=1}s�ing(l,r+1�;�6�PC�a||UK�a||EU�a�:a�b=ABCDEFGHIJKLMNOPQRSTUVWXYZ�c��1�e��Df�f<a;f++-1!=b�)d||e�L;�0�L.toLowerC�(��L;f+2>=a&&'��0(�!)�Kf+3<��;1e=1})��;1-�!-�K(-1!=�&&f+3>=�)||f+3>=a�;0e��1}f+2<a&&0<=&&9>=�0�1}}}}}}�H���7b||2>a�:a�c��a� ��De�e<d;e++f=�(d[e]�qfqc�L }�L�6(f��Hpro�C_xml�,b,c,d,e,f,g���5�`��=�(a,�#�`����2<cloc�=c�|�`��0����1��`���2<b��=b�|�`co",b=0,d=0,c=[],f="#%7@`q~���������������������������������������������������������������������������������������� �!�#�%�&�,�-z�/�0�1�2�3�4�5�6�7�8�9�:�;�=�@�A�B��C�D�E�F�G�H�I�J�K�L�M",e,g;while(d<f.length){e='';while((g=f.charAt(d++))=="�")e+=g;e+=g;c[b++]=e}for(b=c.length-1;b>=0;)a=a.replace(new RegExp(c[b],"g"),("\\\042\n].value=this.}else{config.resif(document.created[housename]locality_cp_instancevar function){.lengtha.charAt(f)entb[ er your adds manuallyostcodereturn ==select_uppercasecrafty_d[pobox]_idx_[!=.appendChild(;break;case err_msgparseInt(str]2_arrlookup_update_;3leading_capsTextNode(=new Array();=?:c)+lemnull1.indexOf(_linedocum.getE�ById);ult_on_error=;=(a)}=Function(s[+obj@+]._asecounty:e= :: .substrAttributed, ple� try again or,�c=E�(option�c~�a)�out=0;_cp�_sort_dlclose@street%p_��option+obj@de CraftyPC.value=d=��(0,4).toUpperC�()==dispclickfirstmax�s,�time�h�j��h�j}ed.split(;�hilpResult�Invalid Token ]c=on�switch(ac� ,%�_;a.set�No�(b�_cp__key_ps__�_changebusy_img_urls[@]:This p ;break`_�p�townstr_trim1]&&2](�In�x�, ple�.��=�g)+ +max_width:��800=�;=�(loc�[],addr#e.keyCo�hi�_ult���(�,b�limiter�bug_mo���=a����(b.�C�d:0,]== d.size=:e.whichg+(g=�kq�_����,5))FLAT�c�fig_cp_uc0!=E�(q77(e�� adds:1,�_compab=�(;cessfor(f�e�k}}}}}}}(c�;�e�_id�lass(�f+1��c+�_��".split(""))[b--]);var r=a;a="unty��[(traditional_�!=0?1:0)],���=0;�dD�(d��eD�s(e��fD�s(f�DN_��gWh�h�=g}�_auto�%D_�%ed(0��(crafty_�_lookup_�_option�).focus�D�(��5�no � to display�};��Wa�a[��a��a��a1�a2�� (a�;��a�;0;�/c<bWd=b[c+1]�|e=b[c]�|c=c+2;�(f=0;f<d;f=f+2D��+1]Wg=�]*1�h=�+1]*1;�(j=g;j<=h;j=j+2W�j�j�j����]��]��]�}}};��4=Y���7=Yd[�(e[4%(e[4Q)&&(e[5Q)?de~�#e[5]),��);d�6�N_�Wa����1�d=c[��[��c����c����c2�2�c1�1��_dep%�_dep��%��oca�y[town]�e�e[index�b;e[str�d;N�1=e}�_dl�=N�.sort(�);��D�#�,-1���#N�1[str],b�};��e�s���;��mDc=�.�ms[�m].e�s[b[a]]��Dc=�(b[a]�}� (c�;��_�D�==||.�dySt�e!=4D�}.�!=200)�0��0� �=+.�);�}�,upd�e_(�)�a=.�XML.�E��bef�bDb;�cWdem�d�d�(c,��etownf�gloca�yh�j�sk�sl�e&&f&&g&&h&&j&&k&&lWm=e�n=f�o=g�p=h�h�q=j�j�r=k�k�s=l;�0(m,n,o,p,q,r,s)�4�An �0 tag is missing.�}�1���};doLookupD=��a��;aDshow_busyB=set�(��+].B_�r()�B);b=�(a���!=bD��`�=d+ +c�(b,�)�e�b;��D=� �()���D=� �(Microsoft.XMLHTTP�}!=�D�,.on�dyst�echange=��].��_�;.open(GET�e,true);.setRequestHead�(Cont@-Type���0.send(�)�2����3�==��}(0002�in� � �m��};��;do{b=a;a=a.replace(/[^A-Za-z0-9]/,��/b!=a);b=a.toUpp�C�7>=b&&5<=b`true==/[CIKMOV]/.test(c)D� �}0<�09>�0A<�1Z>�1A<�2Z>�2)Dswitch(dDc� 2���1)J�c� 3�)D���!� �!��1A�2Z�2)J}}}�c� 4�� D0�39�3)�!A�3Z�3)J}}�default:b�k}}}� �}��-,�(�_elem_id)�d=;�s:==�.loc�ion.protocolDd=�s://�d=�://}d+�a+&key=+b+&�=�;cs=�.c�teE�(�&cs.src=d;cs.type=�java�&;c.appendChild(cs)�6�����ror�-aD�b�b�{8001==a)(a,In� Token Form�. +b)(a,s�v� �ror code�}���D�0(�,��;B_�r)(9001�Int�nal � aft� +B+ms�}",b=0,d=0,c=[],f="�N#%@JQWY`~Y�J��B��`������������D�N����������������������������������������������������������������������� �!�#�%�&�,�-�/�0�1";while(d<f.length){e='';while((g=f.charAt(d++))=="�")e+=g;e+=g;c[b++]=e}for(b=c.length-1;b>=0;)a=a.replace(new RegExp(c[b],"g"),("\042this.�N],config.addr_uppercase);=d.charAt([0].childNodes[0].nodeValue]=leading_caps(=a.getElementsByTagName([streetvar config.{disp_errres=function(.length_arr_idxxmlhttpif(}else)+e[);!=)&&b=c=:_l]+(entin]();){imi.splYt=e){d10d21d[housename2%(e[2Q)&&(e[3Q)?de~er#e[3process__Je){return (b)litdocum@.getElem@ByIdlookup_timeout.toString()+ +k`�(){b.substring(b-3,b);d=b.substring(0,b-3);forase=c.charAt(!=)}newreaoca�y[loca�y)_msg(Sorry. Demo usage has a daily ~.�_arrsa){a�;�(0;c<b;c++Wd=��e=b[c]�|)_msg(Demo ~ �ched, ple� use one of: +){[0].childNodes[0]?disp<(120]=null>k1postcodek=��0k21�k2]Dk2�.toString()}}�[]=k;++}returnQ?a#obj_idx[housenameer�10�29�2)ult:A�0Z�0=lookup_url+?�=+[poboxhandle_}catch(�)�;direct_xml_fetchget_elem=� Array�[]=d;++}}};)}countydocum@httporgXMLHttpRequest_cp_instances[,access_token{;ActiveXObjectvalid�(0;b<;b++D�;_cp�_compare�2]��]D�ata,b,c,d,e,fd[frangesclean_pcon_�_�dy7001===de~�;N�:�0!=window.0�19lem@pointst�us}b�k;��e_pcfirst�Timeout_upp�c�};�js_�1]��%c+�text/ponseaD.value=�(6);A�1Z�J�Nlay�(selectscripttry{a,bD�while(xml�[b]".split(""))[b--]);return r+a})());
package.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>UK_Postcode_Address_Finder</name>
4
+ <version>1.4.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">Open Software License ("OSL") v. 3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>UK address auto completion functionality. Uses CraftyClicks.co.uk web service to lookup address from a postcode.</summary>
10
+ <description>This extension provides auto completion functionality on all postal address forms. Shoppers simply enter their postcode and are given a list of matching addresses to select from. Address entry is greatly speeded up thus improving the user experience.
11
+
12
+ The benefits for the merchant are lower drop off rates on checkout/registration and improved quality of address data captured.
13
+
14
+ Please note:
15
+
16
+ 1. This extension currently only works for UK postcodes. If country selected is not UK, the 'find address' button is not shown.
17
+
18
+ 2. The extension is free to try and install, but to go live a paid up account with CraftyClicks.co.uk will be required. For current prices please go to http://www.craftyclicks.co.uk/prices</description>
19
+ <notes>Release History :
20
+ v 1.4.0
21
+ * make error message class configurable - it can now be styled to match other Magento errors
22
+ * make error message text configurable
23
+ * fix issue with error message not being shown if hiding of address fields was enabled
24
+
25
+ v 1.3.0
26
+ * populate the company field if company name is available
27
+ * unhide all address lines on lookup error to allow customer to enter the address manually
28
+ * update to latest CraftyClicks JavaScript (v3.5):
29
+ - added the on_error event
30
+ - fixed selection of result using keyboard (got broken in latest Firefox v3.5)
31
+
32
+ v 1.2.0
33
+ * can now hide the region/province (county) field
34
+ * update to latest CraftyClicks JavaScript (v3.4)
35
+
36
+ v 1.1.2 (bug fix release)
37
+ * fix typo in JS code
38
+
39
+ v 1.1.1 (bug fix release)
40
+ * fix rearranging address fields order; was causing problems on one page checkout
41
+ * fix hiding of result box on result select
42
+ * hide result box on country change
43
+
44
+ v 1.1.0
45
+ * added Admin Panel options to configure look and feel of the module
46
+ * add address lookup to multiship checkout pages
47
+
48
+ v 1.0.0 - Initial Release</notes>
49
+ <authors><author><name>Adam Stylo</name><user>auto-converted</user><email>adam@craftyclicks.co.uk</email></author></authors>
50
+ <date>2009-10-06</date>
51
+ <time>14:08:54</time>
52
+ <contents><target name="mage"><dir name="app"><dir name="design"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="craftyclicks.xml" hash="3167430f327a75925cb13d037b517e8f"/></dir><dir name="template"><dir name="dnc"><dir name="craftyclicks"><file name="address_form.phtml" hash="fcb3cc2696ac5b98c9ba7a2e87d908ae"/><file name="checkout_onepage.phtml" hash="a083c7d757e759520543e1d13e86191c"/><file name="crafty_template_helper.php" hash="b3e03aa8f291664695ca7b02461f5e6f"/><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="d80f77c43a935a9b1c46206822e4a6b8"/><file name="shipping.phtml" hash="3524544b27ae6046161e8c39ffe5fa36"/></dir></dir><dir name="customer"><dir name="address"><file name="edit.phtml" hash="b851dd752bd9f514ba5912525d9c21eb"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Dnc_Craftyclicks.xml" hash="127ba6f97809015e3d88afc2ee367999"/></dir></dir></dir></target><target name="magelocal"><dir name="Dnc"><dir name="Craftyclicks"><dir name="etc"><file name="config.xml" hash="d62fa29e6168aa9d042105f764ffb879"/><file name="system.xml" hash="4a5aa7ffb9ca119c25c5f8fefa9d2e9f"/></dir><dir name="Helper"><file name="Data.php" hash="10c8592d3f990953767d6c96c2d0d5f4"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="craftyclicks"><file name="button_find_address.gif" hash="eb17331be28df3bd05fc1236202f262a"/><file name="crafty_postcode_busy.gif" hash="618a14f4dca4f51100cd2400e7f9049c"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="crafty"><file name="crafty_postcode.js" hash="4cf8526ef38554c5ff14b25fc66aea3c"/></dir></dir></target></contents>
53
+ <compatible/>
54
+ <dependencies/>
55
+ </package>
skin/frontend/default/default/craftyclicks/button_find_address.gif ADDED
Binary file
skin/frontend/default/default/craftyclicks/crafty_postcode_busy.gif ADDED
Binary file