UK_Postcode_Address_Finder - Version 2.5.0

Version Notes

Release History
v2.5.0
* Major Code Rework.

v2.4.9
* Added support for Awesome Checkout

v2.4.8
* Added support for the new Responsive Magento Template. New option in settings: Button Absolute Position.
* If the company field is hidden, push the company data into the address field.

v2.4.7
*Added support for AITOC Checkout.

v2.4.6
* Added support for Amesty One Step Checkout. Updated IWD Checkout support for a newer version. (backwards compatible to older IWD versions)

v2.4.5
* fix packaging issue with v2.4.4, no changes.

v2.4.4
* update support for Templates Master Firecheckout
* test and mark as Magento 1.8 compatible

v2.4.3
* add support of AheadWorks OneStepCheckout

v2.4.2
* add support for further one-page-checkout extensions, supported now are: AHT, EcommerceTeam, GoMage, IWD, Magestore, Mage World, OneStepCheckout, Tempates Master, Vinagento, Web Experiment
* small changes to config settings

v2.4.1
* add support for Magestore OneStepCheckout
* bug fix - if county field is hidden, don't populate it

v2.4.0
* major rework. Keeping compatible with the growing list of one-page-checkout extensions was a pain.
* now using the Magento prototype JS framework to do most of the heavy lifiting. Less tweaks to .phtml files means we can better maintain compativility with all possible checkout layouts.

v2.3.3
* no changes - repackaged to keep Magento Connect happy

v 2.3.2
* update to GoMage integration

v 2.3.1
* workaround for Firefox 4 bug

v 2.3.0
* updated to support Magento v 1.5

v 2.2.0
* added support for Gomage Light Checkout

v 2.1.0
* added support for One Step Checkout

v 2.0.2
* fix layout problem on in IE8 on onepage checkout

v 2.0.1
* fix minor typo in default config

v 2.0
* big re-design for compatibility with Magento 1.4
* added ability to search by house name/number + postcode (previous versions can search by postcode only)
* pressing enter key in the postcode input field does a search

v 1.6.2
* fix for Internet Explorer in admin panel - new customer page; the add address button didn't always work
* use default country in admin pannel - Magento doesn't do this by default
* in one page checkout unhide billing address fields on 'continue' - this esures any error messages are placed correctly if parts of the address are missing

v 1.6.1
* fix for admin panel - sales pages; Added a 1s delay before CraftyClicks stuff is added to a form.
In some rare cases the timing was such that the form may not yet exist in DOM when we tried to add
address finder button etc.

v 1.6.0
* added address lookup to the admin panel, to change order of address fields please see the
documentation tab - http://www.magentocommerce.com/boards/viewchild/17082/

v 1.5.1
* small modification following tests with the blank theme (changed order of initialisation in JavaScript)

v 1.5.0
* add config option for 1st result line.
* avoid using JavaScript DOM for modifying address forms - it was conflicting with Magento JavaScript.
We now edit the template .phtml files directly.
* fix problems with re-displaying state select box when country is changed from UK to USA.
* fix problem with postcode error message affecting button position if form was submitted with a blank postcode.

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 Crafty Clicks
Extension UK_Postcode_Address_Finder
Version 2.5.0
Comparing to
See all releases


Code changes from version 2.4.9 to 2.5.0

Files changed (34) hide show
  1. app/code/community/Craftyclicks/Clicktoaddress/Helper/Data.php +5 -0
  2. app/code/community/Craftyclicks/Clicktoaddress/data/craftyclicks_clicktoaddress_setup/data-upgrade-2.4.9-2.5.0.php +42 -0
  3. app/code/community/Craftyclicks/Clicktoaddress/etc/config.xml +102 -0
  4. app/code/{local/CraftyClicks → community/Craftyclicks/Clicktoaddress}/etc/system.xml +216 -213
  5. app/code/local/CraftyClicks/Helper/Data.php +0 -15
  6. app/code/local/CraftyClicks/etc/config.xml +0 -72
  7. app/design/adminhtml/default/default/layout/{craftyclicks.xml → craftyclicks_clicktoaddress.xml} +13 -13
  8. app/design/adminhtml/default/default/template/craftyclicks/clicktoaddress/common_config.phtml +65 -0
  9. app/design/adminhtml/default/default/template/craftyclicks/common_config.phtml +0 -64
  10. app/design/frontend/base/default/layout/craftyclicks.xml +0 -155
  11. app/design/frontend/base/default/layout/craftyclicks_clicktoaddress.xml +155 -0
  12. app/design/frontend/base/default/template/craftyclicks/clicktoaddress/common_config.phtml +87 -0
  13. app/design/frontend/base/default/template/craftyclicks/common_config.phtml +0 -86
  14. app/etc/modules/CraftyClicks.xml +1 -2
  15. app/etc/modules/Craftyclicks_Clicktoaddress.xml +10 -0
  16. js/craftyclicks/{crafty_postcode.class.js → clicktoaddress/crafty_postcode.class.js} +0 -0
  17. js/craftyclicks/{craftyclicks_aheadworks_onestepcheckout.js → clicktoaddress/craftyclicks_aheadworks_onestepcheckout.js} +0 -0
  18. js/craftyclicks/{craftyclicks_aitoc_checkout.js → clicktoaddress/craftyclicks_aitoc_checkout.js} +0 -0
  19. js/craftyclicks/{craftyclicks_amesty_onepagecheckout.js → clicktoaddress/craftyclicks_amesty_onepagecheckout.js} +0 -0
  20. js/craftyclicks/{craftyclicks_ath_oscheckout.js → clicktoaddress/craftyclicks_ath_oscheckout.js} +0 -0
  21. js/craftyclicks/{craftyclicks_awesome_checkout.js → clicktoaddress/craftyclicks_awesome_checkout.js} +0 -0
  22. js/craftyclicks/{craftyclicks_ecomm_easycheckout.js → clicktoaddress/craftyclicks_ecomm_easycheckout.js} +0 -0
  23. js/craftyclicks/{craftyclicks_gomage_lightcheckout.js → clicktoaddress/craftyclicks_gomage_lightcheckout.js} +0 -0
  24. js/craftyclicks/{craftyclicks_iwd_onestepcheckout.js → clicktoaddress/craftyclicks_iwd_onestepcheckout.js} +0 -0
  25. js/craftyclicks/{craftyclicks_iwd_onestepcheckout_v2_2.js → clicktoaddress/craftyclicks_iwd_onestepcheckout_v2_2.js} +0 -0
  26. js/craftyclicks/{craftyclicks_magento.js → clicktoaddress/craftyclicks_magento.js} +0 -0
  27. js/craftyclicks/{craftyclicks_magento_admin.js → clicktoaddress/craftyclicks_magento_admin.js} +0 -0
  28. js/craftyclicks/{craftyclicks_onepagecheckout.js → clicktoaddress/craftyclicks_onepagecheckout.js} +0 -0
  29. js/craftyclicks/{craftyclicks_tm_firecheckout.js → clicktoaddress/craftyclicks_tm_firecheckout.js} +0 -0
  30. js/craftyclicks/{craftyclicks_vinagentocheckout.js → clicktoaddress/craftyclicks_vinagentocheckout.js} +0 -0
  31. js/craftyclicks/{craftyclicks_webandpeople_onepagecheckout.js → clicktoaddress/craftyclicks_webandpeople_onepagecheckout.js} +0 -0
  32. package.xml +7 -4
  33. skin/frontend/base/default/images/craftyclicks/{button_find_address.gif → clicktoaddress/button_find_address.gif} +0 -0
  34. skin/frontend/base/default/images/craftyclicks/{crafty_postcode_busy.gif → clicktoaddress/crafty_postcode_busy.gif} +0 -0
app/code/community/Craftyclicks/Clicktoaddress/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Craftyclicks_Clicktoaddress_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/community/Craftyclicks/Clicktoaddress/data/craftyclicks_clicktoaddress_setup/data-upgrade-2.4.9-2.5.0.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $configAccess = new Mage_Core_Model_Config();
4
+ $oldCfg = Mage::getStoreConfig('general');
5
+
6
+ if(isset($oldCfg['craftyclicks'])){
7
+ //old plugin was set
8
+
9
+ // STEP 1: Take cfg over
10
+ if(!($oldCfg['craftyclicks']['access_token'] == 'xxxxx-xxxxx-xxxxx-xxxxx' && $oldCfg['craftyclicks']['access_token_admin_panel'] == 'xxxxx-xxxxx-xxxxx-xxxxx')){
11
+ //old plugin didn't had default values.
12
+ //transfer old config into new one.
13
+ $values = array("active",
14
+ "active_admin_panel",
15
+ "access_token",
16
+ "access_token_admin_panel",
17
+ "button_image",
18
+ "button_class",
19
+ "hide_fields",
20
+ "hide_county",
21
+ "clear_result",
22
+ "error_class",
23
+ "max_res_lines",
24
+ "first_res_line",
25
+ "error_msg_1",
26
+ "error_msg_2",
27
+ "error_msg_3",
28
+ "error_msg_4",
29
+ "button_fixposition");
30
+ $data = array();
31
+ //check if every old cfg exists. (some older versions might not have all of these options)
32
+ foreach($values as $val){
33
+ if(isset($oldCfg['craftyclicks'][$val])){
34
+ $data[$val] = $oldCfg['craftyclicks'][$val];
35
+ }
36
+ }
37
+ foreach($data as $k=>$v){
38
+ $configAccess->saveConfig('clicktoaddress/general/'.$k,$v, 'default', 0);
39
+ }
40
+ }
41
+ }
42
+ ?>
app/code/community/Craftyclicks/Clicktoaddress/etc/config.xml ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Crafty Clicks - Address Finder
5
+ *
6
+ * @category Craftyclicks
7
+ * @package Craftyclicks
8
+ * @copyright Craftyclicks.co.uk
9
+ */
10
+ -->
11
+
12
+ <config>
13
+ <modules>
14
+ <Craftyclicks_Clicktoaddress>
15
+ <version>2.5.0</version>
16
+ </Craftyclicks_Clicktoaddress>
17
+ </modules>
18
+
19
+ <global>
20
+ <helpers>
21
+ <clicktoaddress>
22
+ <class>Craftyclicks_Clicktoaddress_Helper</class>
23
+ </clicktoaddress>
24
+ </helpers>
25
+ </global>
26
+
27
+ <default>
28
+ <clicktoaddress>
29
+ <general>
30
+ <active>0</active>
31
+ <active_admin_panel>0</active_admin_panel>
32
+ <access_token>xxxxx-xxxxx-xxxxx-xxxxx</access_token>
33
+ <access_token_admin_panel>xxxxx-xxxxx-xxxxx-xxxxx</access_token_admin_panel>
34
+ <button_image></button_image>
35
+ <button_class>button</button_class>
36
+ <hide_fields>0</hide_fields>
37
+ <hide_county>1</hide_county>
38
+ <clear_result>0</clear_result>
39
+ <error_class>error</error_class>
40
+ <max_res_lines>1</max_res_lines>
41
+ <first_res_line>----- please select your address ----</first_res_line>
42
+ <error_msg_1>This postcode could not be found, please try again or enter your address manually</error_msg_1>
43
+ <error_msg_2>This postcode is not valid, please try again or enter your address manually</error_msg_2>
44
+ <error_msg_3>Unable to connect to address lookup server, please enter your address manually</error_msg_3>
45
+ <error_msg_4>An unexpected error occured, please enter your address manually</error_msg_4>
46
+ <button_fixposition>0</button_fixposition>
47
+ </general>
48
+ </clicktoaddress>
49
+ </default>
50
+
51
+ <frontend>
52
+ <layout>
53
+ <updates>
54
+ <craftyclicks_clicktoaddress module="Craftyclicks_Clicktoaddress">
55
+ <file>craftyclicks_clicktoaddress.xml</file>
56
+ </craftyclicks_clicktoaddress>
57
+ </updates>
58
+ </layout>
59
+ </frontend>
60
+
61
+ <adminhtml>
62
+ <layout>
63
+ <updates>
64
+ <craftyclicks_clicktoaddress module="Craftyclicks_Clicktoaddress">
65
+ <file>craftyclicks_clicktoaddress.xml</file>
66
+ </craftyclicks_clicktoaddress>
67
+ </updates>
68
+ </layout>
69
+ <acl>
70
+ <resources>
71
+ <all>
72
+ <title>Allow Everything</title>
73
+ </all>
74
+ <admin>
75
+ <children>
76
+ <system>
77
+ <children>
78
+ <config>
79
+ <children>
80
+ <clicktoaddress translate="title" module="clicktoaddress">
81
+ <title>clicktoaddress - All</title>
82
+ </clicktoaddress>
83
+ </children>
84
+ </config>
85
+ </children>
86
+ </system>
87
+ </children>
88
+ </admin>
89
+ </resources>
90
+ </acl>
91
+ </adminhtml>
92
+
93
+ <global>
94
+ <resources>
95
+ <craftyclicks_clicktoaddress_setup>
96
+ <setup>
97
+ <module>Craftyclicks_Clicktoaddress</module>
98
+ </setup>
99
+ </craftyclicks_clicktoaddress_setup>
100
+ </resources>
101
+ </global>
102
+ </config>
app/code/{local/CraftyClicks → community/Craftyclicks/Clicktoaddress}/etc/system.xml RENAMED
@@ -1,213 +1,216 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Crafty Clicks
5
- *
6
- * @category CraftyClicks
7
- * @package CraftyClicks_AddressFinder
8
- * @copyright CraftyClicks.co.uk
9
- */
10
- -->
11
-
12
- <config>
13
- <sections>
14
- <general>
15
- <groups>
16
- <craftyclicks translate="label" module="craftyclicks">
17
- <label>Crafty Clicks - Address Finder</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 - Frontend</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
- <active_admin_panel translate="label">
34
- <label>Enabled - Admin Panel</label>
35
- <frontend_type>select</frontend_type>
36
- <source_model>adminhtml/system_config_source_yesno</source_model>
37
- <sort_order>2</sort_order>
38
- <show_in_default>1</show_in_default>
39
- <show_in_website>1</show_in_website>
40
- <show_in_store>0</show_in_store>
41
- </active_admin_panel>
42
-
43
- <access_token translate="label">
44
- <label>Access Token - Frontend</label>
45
- <frontend_type>text</frontend_type>
46
- <sort_order>5</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>Your access token for use on the public facing website. This should be set to "web/external" use in your Crafty Clicks MyAccount.</comment>
51
- </access_token>
52
-
53
- <access_token_admin_panel translate="label">
54
- <label>Access Token - Admin Panel</label>
55
- <frontend_type>text</frontend_type>
56
- <sort_order>6</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>Your access token for use on the internal admin panel. This should be set to "internal" use in your Crafty Clicks MyAccount. Contact us if you need more info on licensing.</comment>
61
- </access_token_admin_panel>
62
-
63
- <button_image translate="label">
64
- <label>Button Image</label>
65
- <frontend_type>text</frontend_type>
66
- <sort_order>12</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>Here you can enter an image file name to use as the 'Find Address' button. Leave blank for a default Magento button. Images should be placed under images/craftclicks in you skin folder.</comment>
71
- </button_image>
72
-
73
- <button_class translate="label">
74
- <label>Button Class</label>
75
- <frontend_type>text</frontend_type>
76
- <sort_order>13</sort_order>
77
- <show_in_default>1</show_in_default>
78
- <show_in_website>1</show_in_website>
79
- <show_in_store>0</show_in_store>
80
- <comment>Here you can set the css class to use for the 'Find Address' button. Leave blank for a browser default button. Try 'button'.</comment>
81
- </button_class>
82
-
83
- <button_fixposition translate="label">
84
- <label>Button Absolute Position</label>
85
- <frontend_type>select</frontend_type>
86
- <source_model>adminhtml/system_config_source_yesno</source_model>
87
- <sort_order>14</sort_order>
88
- <show_in_default>1</show_in_default>
89
- <show_in_website>1</show_in_website>
90
- <show_in_store>0</show_in_store>
91
- <comment>Force button to be displayed right next to the postcode input box. (required for the new default magento template)</comment>
92
- </button_fixposition>
93
-
94
-
95
- <hide_fields translate="label">
96
- <label>Hide Address Fields for New Address Entry</label>
97
- <frontend_type>select</frontend_type>
98
- <source_model>adminhtml/system_config_source_yesno</source_model>
99
- <sort_order>20</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 address fields until a postcode is looked up and an address is selected. Address fields are only hidden if they are blank (i.e. new address entry, not edit).</comment>
104
- </hide_fields>
105
-
106
- <hide_county translate="label">
107
- <label>Hide County Field for UK</label>
108
- <frontend_type>select</frontend_type>
109
- <source_model>adminhtml/system_config_source_yesno</source_model>
110
- <sort_order>22</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 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>
115
- </hide_county>
116
-
117
- <clear_result translate="label">
118
- <label>Clear Result Once Selected</label>
119
- <frontend_type>select</frontend_type>
120
- <source_model>adminhtml/system_config_source_yesno</source_model>
121
- <sort_order>25</sort_order>
122
- <show_in_default>1</show_in_default>
123
- <show_in_website>1</show_in_website>
124
- <show_in_store>0</show_in_store>
125
- <comment>Select to hide the result box once an address is selected.</comment>
126
- </clear_result>
127
-
128
- <error_class translate="label">
129
- <label>Error Msg Class</label>
130
- <frontend_type>text</frontend_type>
131
- <sort_order>30</sort_order>
132
- <show_in_default>1</show_in_default>
133
- <show_in_website>1</show_in_website>
134
- <show_in_store>0</show_in_store>
135
- <comment>Set the css class to use for the error messages. Try 'error-msg', 'error' or even leave it blank.</comment>
136
- </error_class>
137
-
138
- <max_res_lines translate="label">
139
- <label>Result Box Lines</label>
140
- <frontend_type>text</frontend_type>
141
- <sort_order>32</sort_order>
142
- <show_in_default>1</show_in_default>
143
- <show_in_website>1</show_in_website>
144
- <show_in_store>0</show_in_store>
145
- <comment>Maximum number of lines to show in the result drop-down box.</comment>
146
- </max_res_lines>
147
-
148
- <first_res_line translate="label">
149
- <label>First Result Line</label>
150
- <frontend_type>text</frontend_type>
151
- <sort_order>33</sort_order>
152
- <show_in_default>1</show_in_default>
153
- <show_in_website>1</show_in_website>
154
- <show_in_store>0</show_in_store>
155
- <comment>Text to place as first line in the result drop-down box.</comment>
156
- </first_res_line>
157
-
158
- <error_msg_1 translate="label">
159
- <label>Error Msg #1</label>
160
- <frontend_type>text</frontend_type>
161
- <sort_order>35</sort_order>
162
- <show_in_default>1</show_in_default>
163
- <show_in_website>1</show_in_website>
164
- <show_in_store>0</show_in_store>
165
- <comment>This message is shown if the postcode is in valid format, but not found int the database.</comment>
166
- </error_msg_1>
167
-
168
- <error_msg_2 translate="label">
169
- <label>Error Msg #2</label>
170
- <frontend_type>text</frontend_type>
171
- <sort_order>37</sort_order>
172
- <show_in_default>1</show_in_default>
173
- <show_in_website>1</show_in_website>
174
- <show_in_store>0</show_in_store>
175
- <comment>This message is shown if the postcode format is not valid.</comment>
176
- </error_msg_2>
177
-
178
- <error_msg_3 translate="label">
179
- <label>Error Msg #3</label>
180
- <frontend_type>text</frontend_type>
181
- <sort_order>39</sort_order>
182
- <show_in_default>1</show_in_default>
183
- <show_in_website>1</show_in_website>
184
- <show_in_store>0</show_in_store>
185
- <comment>This message is shown if the connection to lookup server times out.</comment>
186
- </error_msg_3>
187
-
188
- <error_msg_4 translate="label">
189
- <label>Error Msg #4</label>
190
- <frontend_type>text</frontend_type>
191
- <sort_order>41</sort_order>
192
- <show_in_default>1</show_in_default>
193
- <show_in_website>1</show_in_website>
194
- <show_in_store>0</show_in_store>
195
- <comment>This message is shown if any other error occurs.</comment>
196
- </error_msg_4>
197
-
198
- <help_label translate="label">
199
- <label>Problems?</label>
200
- <frontend_type>label</frontend_type>
201
- <sort_order>50</sort_order>
202
- <show_in_default>1</show_in_default>
203
- <show_in_website>1</show_in_website>
204
- <show_in_store>0</show_in_store>
205
- <comment>Look on the module magento connect page, or email support@craftyclicks.co.uk.</comment>
206
- </help_label>
207
- </fields>
208
- <comment><![CDATA[<a href="http://www.craftyclicks.co.uk" target="_blank">Signup for your free CraftyClicks evaluation account</a>]]></comment>
209
- </craftyclicks>
210
- </groups>
211
- </general>
212
- </sections>
213
- </config>
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <craftyclicks translate="label" module="clicktoaddress">
5
+ <label><![CDATA[<img style="margin: 4px 4px 4px 0px;" src="https://craftyclicks.co.uk/assets/magento/crafty-logo.png" alt="Crafty Clicks" border="0" />]]></label>
6
+ <sort_order>101</sort_order>
7
+ </craftyclicks>
8
+ </tabs>
9
+
10
+ <sections>
11
+ <clicktoaddress translate="label" module="clicktoaddress">
12
+ <label>UK Postcode Lookup</label>
13
+ <tab>craftyclicks</tab>
14
+ <sort_order>100</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
+
19
+ <groups>
20
+ <general translate="label" module="clicktoaddress">
21
+ <comment>
22
+ <![CDATA[
23
+ For support, visit our <a href="http://www.magentocommerce.com/magento-connect/uk-postcode-lookup-address-finder.html">magento connect page</a>, or email to <a href="mailto:support@craftyclicks.co.uk">support@craftyclicks.co.uk</a>
24
+ <br/>
25
+ For current pricing and licensing, please visit <a href="https://craftyclicks.co.uk/">our website</a>!
26
+ ]]>
27
+ </comment>
28
+ <label>UK Postcode Lookup Config</label>
29
+ <frontend_type>text</frontend_type>
30
+ <sort_order>1000</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+
35
+ <fields>
36
+ <active translate="label">
37
+ <label>Enabled - Frontend</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_yesno</source_model>
40
+ <sort_order>1</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>0</show_in_store>
44
+ </active>
45
+
46
+ <active_admin_panel translate="label">
47
+ <label>Enabled - Admin Panel</label>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_yesno</source_model>
50
+ <sort_order>2</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>0</show_in_store>
54
+ </active_admin_panel>
55
+
56
+ <access_token translate="label">
57
+ <label>Access Token - Frontend</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>5</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ <comment>Your access token for use on the public facing website. This should be set to "web/external" use in your Crafty Clicks MyAccount.</comment>
64
+ </access_token>
65
+
66
+ <access_token_admin_panel translate="label">
67
+ <label>Access Token - Admin Panel</label>
68
+ <frontend_type>text</frontend_type>
69
+ <sort_order>6</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ <comment>Your access token for use on the internal admin panel. This should be set to "internal" use in your Crafty Clicks MyAccount. Contact us if you need more info on licensing.</comment>
74
+ </access_token_admin_panel>
75
+
76
+ <button_image translate="label">
77
+ <label>Button Image</label>
78
+ <frontend_type>text</frontend_type>
79
+ <sort_order>12</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>0</show_in_store>
83
+ <comment>Here you can enter an image file name to use as the 'Find Address' button. Leave blank for a default Magento button. Images should be placed under images/craftclicks in you skin folder.</comment>
84
+ </button_image>
85
+
86
+ <button_class translate="label">
87
+ <label>Button Class</label>
88
+ <frontend_type>text</frontend_type>
89
+ <sort_order>13</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>0</show_in_store>
93
+ <comment>Here you can set the css class to use for the 'Find Address' button. Leave blank for a browser default button. Try 'button'.</comment>
94
+ </button_class>
95
+
96
+ <button_fixposition translate="label">
97
+ <label>Button Absolute Position</label>
98
+ <frontend_type>select</frontend_type>
99
+ <source_model>adminhtml/system_config_source_yesno</source_model>
100
+ <sort_order>14</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>0</show_in_store>
104
+ <comment>Force button to be displayed right next to the postcode input box. (required for the new default magento template)</comment>
105
+ </button_fixposition>
106
+
107
+
108
+ <hide_fields translate="label">
109
+ <label>Hide Address Fields for New Address Entry</label>
110
+ <frontend_type>select</frontend_type>
111
+ <source_model>adminhtml/system_config_source_yesno</source_model>
112
+ <sort_order>20</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>0</show_in_store>
116
+ <comment>Select to hide address fields until a postcode is looked up and an address is selected. Address fields are only hidden if they are blank (i.e. new address entry, not edit).</comment>
117
+ </hide_fields>
118
+
119
+ <hide_county translate="label">
120
+ <label>Hide County Field for UK</label>
121
+ <frontend_type>select</frontend_type>
122
+ <source_model>adminhtml/system_config_source_yesno</source_model>
123
+ <sort_order>22</sort_order>
124
+ <show_in_default>1</show_in_default>
125
+ <show_in_website>1</show_in_website>
126
+ <show_in_store>0</show_in_store>
127
+ <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>
128
+ </hide_county>
129
+
130
+ <clear_result translate="label">
131
+ <label>Clear Result Once Selected</label>
132
+ <frontend_type>select</frontend_type>
133
+ <source_model>adminhtml/system_config_source_yesno</source_model>
134
+ <sort_order>25</sort_order>
135
+ <show_in_default>1</show_in_default>
136
+ <show_in_website>1</show_in_website>
137
+ <show_in_store>0</show_in_store>
138
+ <comment>Select to hide the result box once an address is selected.</comment>
139
+ </clear_result>
140
+
141
+ <error_class translate="label">
142
+ <label>Error Msg Class</label>
143
+ <frontend_type>text</frontend_type>
144
+ <sort_order>30</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>1</show_in_website>
147
+ <show_in_store>0</show_in_store>
148
+ <comment>Set the css class to use for the error messages. Try 'error-msg', 'error' or even leave it blank.</comment>
149
+ </error_class>
150
+
151
+ <max_res_lines translate="label">
152
+ <label>Result Box Lines</label>
153
+ <frontend_type>text</frontend_type>
154
+ <sort_order>32</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>0</show_in_store>
158
+ <comment>Maximum number of lines to show in the result drop-down box.</comment>
159
+ </max_res_lines>
160
+
161
+ <first_res_line translate="label">
162
+ <label>First Result Line</label>
163
+ <frontend_type>text</frontend_type>
164
+ <sort_order>33</sort_order>
165
+ <show_in_default>1</show_in_default>
166
+ <show_in_website>1</show_in_website>
167
+ <show_in_store>0</show_in_store>
168
+ <comment>Text to place as first line in the result drop-down box.</comment>
169
+ </first_res_line>
170
+
171
+ <error_msg_1 translate="label">
172
+ <label>Error Msg #1</label>
173
+ <frontend_type>text</frontend_type>
174
+ <sort_order>35</sort_order>
175
+ <show_in_default>1</show_in_default>
176
+ <show_in_website>1</show_in_website>
177
+ <show_in_store>0</show_in_store>
178
+ <comment>This message is shown if the postcode is in valid format, but not found int the database.</comment>
179
+ </error_msg_1>
180
+
181
+ <error_msg_2 translate="label">
182
+ <label>Error Msg #2</label>
183
+ <frontend_type>text</frontend_type>
184
+ <sort_order>37</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>0</show_in_store>
188
+ <comment>This message is shown if the postcode format is not valid.</comment>
189
+ </error_msg_2>
190
+
191
+ <error_msg_3 translate="label">
192
+ <label>Error Msg #3</label>
193
+ <frontend_type>text</frontend_type>
194
+ <sort_order>39</sort_order>
195
+ <show_in_default>1</show_in_default>
196
+ <show_in_website>1</show_in_website>
197
+ <show_in_store>0</show_in_store>
198
+ <comment>This message is shown if the connection to lookup server times out.</comment>
199
+ </error_msg_3>
200
+
201
+ <error_msg_4 translate="label">
202
+ <label>Error Msg #4</label>
203
+ <frontend_type>text</frontend_type>
204
+ <sort_order>41</sort_order>
205
+ <show_in_default>1</show_in_default>
206
+ <show_in_website>1</show_in_website>
207
+ <show_in_store>0</show_in_store>
208
+ <comment>This message is shown if any other error occurs.</comment>
209
+ </error_msg_4>
210
+ </fields>
211
+ </general>
212
+ </groups>
213
+ </clicktoaddress>
214
+ </sections>
215
+
216
+ </config>
app/code/local/CraftyClicks/Helper/Data.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- /**
3
- * Crafty Clicks - Address Finder
4
- *
5
- * @category CraftyClicks
6
- * @package CraftyClicks
7
- * @copyright CraftyClicks.co.uk
8
- */
9
-
10
- include_once 'Mage/Core/Helper/Abstract.php';
11
-
12
- class CraftyClicks_Helper_Data extends Mage_Core_Helper_Abstract
13
- {
14
-
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/CraftyClicks/etc/config.xml DELETED
@@ -1,72 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Crafty Clicks - Address Finder
5
- *
6
- * @category CraftyClicks
7
- * @package CraftyClicks
8
- * @copyright CraftyClicks.co.uk
9
- */
10
- -->
11
-
12
- <config>
13
- <modules>
14
- <CraftyClicks>
15
- <version>2.4.9</version>
16
- </CraftyClicks>
17
- </modules>
18
-
19
- <frontend>
20
- <layout>
21
- <updates>
22
- <craftyclicks>
23
- <file>craftyclicks.xml</file>
24
- </craftyclicks>
25
- </updates>
26
- </layout>
27
- </frontend>
28
-
29
- <adminhtml>
30
- <layout>
31
- <updates>
32
- <craftyclicks>
33
- <file>craftyclicks.xml</file>
34
- </craftyclicks>
35
- </updates>
36
- </layout>
37
- </adminhtml>
38
-
39
-
40
- <global>
41
- <helpers>
42
- <craftyclicks>
43
- <class>CraftyClicks_Helper</class>
44
- </craftyclicks>
45
- </helpers>
46
- </global>
47
-
48
- <default>
49
- <general>
50
- <craftyclicks>
51
- <active>0</active>
52
- <active_admin_panel>0</active_admin_panel>
53
- <model>craftyclicks</model>
54
- <access_token>xxxxx-xxxxx-xxxxx-xxxxx</access_token>
55
- <access_token_admin_panel>xxxxx-xxxxx-xxxxx-xxxxx</access_token_admin_panel>
56
- <button_image></button_image>
57
- <button_class>button</button_class>
58
- <hide_fields>0</hide_fields>
59
- <hide_county>1</hide_county>
60
- <clear_result>0</clear_result>
61
- <error_class>error</error_class>
62
- <max_res_lines>1</max_res_lines>
63
- <first_res_line>----- please select your address ----</first_res_line>
64
- <error_msg_1>This postcode could not be found, please try again or enter your address manually</error_msg_1>
65
- <error_msg_2>This postcode is not valid, please try again or enter your address manually</error_msg_2>
66
- <error_msg_3>Unable to connect to address lookup server, please enter your address manually</error_msg_3>
67
- <error_msg_4>An unexpected error occured, please enter your address manually</error_msg_4>
68
- <button_fixposition>0</button_fixposition>
69
- </craftyclicks>
70
- </general>
71
- </default>
72
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/{craftyclicks.xml → craftyclicks_clicktoaddress.xml} RENAMED
@@ -12,47 +12,47 @@
12
  <layout>
13
  <adminhtml_sales_order_create_index>
14
  <reference name="head">
15
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
16
- <action method="addJs"><script>craftyclicks/craftyclicks_magento_admin.js</script></action>
17
  </reference>
18
  <reference name="js">
19
- <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/common_config.phtml" />
20
  </reference>
21
  </adminhtml_sales_order_create_index>
22
 
23
  <adminhtml_sales_order_create_load_block_data>
24
  <reference name="content">
25
- <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/common_config.phtml" />
26
  </reference>
27
  </adminhtml_sales_order_create_load_block_data>
28
 
29
  <adminhtml_customer_edit>
30
  <reference name="head">
31
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
32
- <action method="addJs"><script>craftyclicks/craftyclicks_magento_admin.js</script></action>
33
  </reference>
34
  <reference name="js">
35
- <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/common_config.phtml" />
36
  </reference>
37
  </adminhtml_customer_edit>
38
 
39
  <adminhtml_customer_new>
40
  <reference name="head">
41
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
42
- <action method="addJs"><script>craftyclicks/craftyclicks_magento_admin.js</script></action>
43
  </reference>
44
  <reference name="js">
45
- <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/common_config.phtml" />
46
  </reference>
47
  </adminhtml_customer_new>
48
 
49
  <adminhtml_sales_order_address>
50
  <reference name="head">
51
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
52
- <action method="addJs"><script>craftyclicks/craftyclicks_magento_admin.js</script></action>
53
  </reference>
54
  <reference name="js">
55
- <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/common_config.phtml" />
56
  </reference>
57
  </adminhtml_sales_order_address>
58
  </layout>
12
  <layout>
13
  <adminhtml_sales_order_create_index>
14
  <reference name="head">
15
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
16
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento_admin.js</script></action>
17
  </reference>
18
  <reference name="js">
19
+ <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml" />
20
  </reference>
21
  </adminhtml_sales_order_create_index>
22
 
23
  <adminhtml_sales_order_create_load_block_data>
24
  <reference name="content">
25
+ <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml" />
26
  </reference>
27
  </adminhtml_sales_order_create_load_block_data>
28
 
29
  <adminhtml_customer_edit>
30
  <reference name="head">
31
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
32
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento_admin.js</script></action>
33
  </reference>
34
  <reference name="js">
35
+ <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml" />
36
  </reference>
37
  </adminhtml_customer_edit>
38
 
39
  <adminhtml_customer_new>
40
  <reference name="head">
41
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
42
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento_admin.js</script></action>
43
  </reference>
44
  <reference name="js">
45
+ <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml" />
46
  </reference>
47
  </adminhtml_customer_new>
48
 
49
  <adminhtml_sales_order_address>
50
  <reference name="head">
51
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
52
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento_admin.js</script></action>
53
  </reference>
54
  <reference name="js">
55
+ <block type="adminhtml/template" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml" />
56
  </reference>
57
  </adminhtml_sales_order_address>
58
  </layout>
app/design/adminhtml/default/default/template/craftyclicks/clicktoaddress/common_config.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $conf = Mage::getStoreConfig('clicktoaddress');
4
+
5
+ $js_config = "";
6
+
7
+ if (1 == $conf['active_admin_panel']) {
8
+ $js_config = " var _cp_integrate = true;";
9
+ $js_config.= " var _cp_enable_for_uk_only = true;"; // if true, the button will show up only for UK
10
+ if (array_key_exists('button_image',$conf) && '' != $conf['button_image']) {
11
+ $js_config.= " var _cp_button_image = '".$this->getSkinUrl('images/craftyclicks/clicktoaddress/'.$conf['button_image'])."';";
12
+ } else {
13
+ $js_config.= " var _cp_button_image = '';";
14
+ }
15
+ $js_config.= " var _cp_button_text = 'Find Address';";
16
+ $js_config.= " var _cp_button_class = '".$conf['button_class']."';";
17
+ $js_config.= " var _cp_result_box_height = '".$conf['max_res_lines']."';"; // number of lines to show in result box, must be 1 or more
18
+ $js_config.= " var _cp_result_box_width = '';"; // width of the result box
19
+ $js_config.= " var _cp_busy_img_url = '';"; // the url of the image to show while waiting for lookup results, e.g. a spinning wheel etc.
20
+
21
+ if (array_key_exists('clear_result',$conf) && $conf['clear_result']) {
22
+ $js_config.= " var _cp_clear_result = true;";
23
+ } else {
24
+ $js_config.= " var _cp_clear_result = false;";
25
+ }
26
+
27
+ $js_config.= " var _cp_hide_result = true;"; // once users make the selection, hide the result box - true/false
28
+ $js_config.= " var _cp_1st_res_line = '".$conf['first_res_line']."';";
29
+ $js_config.= " var _cp_err_msg1 = '".$conf['error_msg_1']."';";
30
+ $js_config.= " var _cp_err_msg2 = '".$conf['error_msg_2']."';";
31
+ $js_config.= " var _cp_err_msg3 = '".$conf['error_msg_3']."';";
32
+ $js_config.= " var _cp_err_msg4 = '".$conf['error_msg_4']."';";
33
+ $js_config.= " var _cp_token_adm = '".$conf['access_token_admin_panel']."';";
34
+
35
+ if (array_key_exists('hide_fields',$conf) && $conf['hide_fields']) {
36
+ $js_config.= " var _cp_hide_fields = true;";
37
+ } else {
38
+ $js_config.= " var _cp_hide_fields = false;";
39
+ }
40
+
41
+ if (array_key_exists('hide_county',$conf) && $conf['hide_county']) {
42
+ $js_config.= " var _cp_hide_county = true;";
43
+ } else {
44
+ $js_config.= " var _cp_hide_county = false;";
45
+ }
46
+
47
+ if (array_key_exists('error_class',$conf) && '' != $conf['error_class']) {
48
+ $js_config.= " var _cp_error_class = '".$conf['error_class']."';";
49
+ } else {
50
+ $js_config.= " var _cp_error_class = '';";
51
+ }
52
+
53
+ } else { //if (1 == $conf['active_admin_panel']) {
54
+ $js_config = " var _cp_integrate = false; ";
55
+ }
56
+ ?>
57
+
58
+ <script type="text/javascript">
59
+ //<![CDATA[
60
+
61
+ <?php echo $js_config; ?>
62
+
63
+ //]]>
64
+ </script>
65
+
app/design/adminhtml/default/default/template/craftyclicks/common_config.phtml DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
-
3
- $conf = Mage::getStoreConfig('general');
4
- $js_config = "";
5
-
6
- if (1 == $conf['craftyclicks']['active_admin_panel']) {
7
- $js_config = " var _cp_integrate = true;";
8
- $js_config.= " var _cp_enable_for_uk_only = true;"; // if true, the button will show up only for UK
9
- if (array_key_exists('button_image',$conf['craftyclicks']) && '' != $conf['craftyclicks']['button_image']) {
10
- $js_config.= " var _cp_button_image = '".$this->getSkinUrl('images/craftyclicks/'.$conf['craftyclicks']['button_image'])."';";
11
- } else {
12
- $js_config.= " var _cp_button_image = '';";
13
- }
14
- $js_config.= " var _cp_button_text = 'Find Address';";
15
- $js_config.= " var _cp_button_class = '".$conf['craftyclicks']['button_class']."';";
16
- $js_config.= " var _cp_result_box_height = '".$conf['craftyclicks']['max_res_lines']."';"; // number of lines to show in result box, must be 1 or more
17
- $js_config.= " var _cp_result_box_width = '';"; // width of the result box
18
- $js_config.= " var _cp_busy_img_url = '';"; // the url of the image to show while waiting for lookup results, e.g. a spinning wheel etc.
19
-
20
- if (array_key_exists('clear_result',$conf['craftyclicks']) && $conf['craftyclicks']['clear_result']) {
21
- $js_config.= " var _cp_clear_result = true;";
22
- } else {
23
- $js_config.= " var _cp_clear_result = false;";
24
- }
25
-
26
- $js_config.= " var _cp_hide_result = true;"; // once users make the selection, hide the result box - true/false
27
- $js_config.= " var _cp_1st_res_line = '".$conf['craftyclicks']['first_res_line']."';";
28
- $js_config.= " var _cp_err_msg1 = '".$conf['craftyclicks']['error_msg_1']."';";
29
- $js_config.= " var _cp_err_msg2 = '".$conf['craftyclicks']['error_msg_2']."';";
30
- $js_config.= " var _cp_err_msg3 = '".$conf['craftyclicks']['error_msg_3']."';";
31
- $js_config.= " var _cp_err_msg4 = '".$conf['craftyclicks']['error_msg_4']."';";
32
- $js_config.= " var _cp_token_adm = '".$conf['craftyclicks']['access_token_admin_panel']."';";
33
-
34
- if (array_key_exists('hide_fields',$conf['craftyclicks']) && $conf['craftyclicks']['hide_fields']) {
35
- $js_config.= " var _cp_hide_fields = true;";
36
- } else {
37
- $js_config.= " var _cp_hide_fields = false;";
38
- }
39
-
40
- if (array_key_exists('hide_county',$conf['craftyclicks']) && $conf['craftyclicks']['hide_county']) {
41
- $js_config.= " var _cp_hide_county = true;";
42
- } else {
43
- $js_config.= " var _cp_hide_county = false;";
44
- }
45
-
46
- if (array_key_exists('error_class',$conf['craftyclicks']) && '' != $conf['craftyclicks']['error_class']) {
47
- $js_config.= " var _cp_error_class = '".$conf['craftyclicks']['error_class']."';";
48
- } else {
49
- $js_config.= " var _cp_error_class = '';";
50
- }
51
-
52
- } else { //if (1 == $conf['craftyclicks']['active_admin_panel']) {
53
- $js_config = " var _cp_integrate = false; ";
54
- }
55
- ?>
56
-
57
- <script type="text/javascript">
58
- //<![CDATA[
59
-
60
- <?php echo $js_config; ?>
61
-
62
- //]]>
63
- </script>
64
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/craftyclicks.xml DELETED
@@ -1,155 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Crafty Clicks Postcode Lookup
5
- *
6
- * @category Extension
7
- * @copyright Copyright (c) 2009-2013 Crafty Clicks (http://www.craftyclicks.com)
8
- * @author Crafty Clicks
9
- */
10
- -->
11
-
12
- <layout>
13
-
14
- <!-- standard magento pages -->
15
-
16
- <checkout_onepage_index>
17
- <reference name="head">
18
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
19
- <action method="addJs"><script>craftyclicks/craftyclicks_magento.js</script></action>
20
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
21
- </reference>
22
- </checkout_onepage_index>
23
-
24
- <checkout_multishipping_customer_address>
25
- <reference name="head">
26
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
27
- <action method="addJs"><script>craftyclicks/craftyclicks_magento.js</script></action>
28
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
29
- </reference>
30
- </checkout_multishipping_customer_address>
31
-
32
- <checkout_multishipping_register>
33
- <reference name="head">
34
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
35
- <action method="addJs"><script>craftyclicks/craftyclicks_magento.js</script></action>
36
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
37
- </reference>
38
- </checkout_multishipping_register>
39
-
40
- <customer_address_form>
41
- <reference name="head">
42
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
43
- <action method="addJs"><script>craftyclicks/craftyclicks_magento.js</script></action>
44
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
45
- </reference>
46
- </customer_address_form>
47
-
48
- <customer_account_create>
49
- <reference name="head">
50
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
51
- <action method="addJs"><script>craftyclicks/craftyclicks_magento.js</script></action>
52
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
53
- </reference>
54
- </customer_account_create>
55
-
56
- <!-- after-market single page checkout extensions -->
57
-
58
- <onestepcheckout_index_index>
59
- <reference name="head">
60
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
61
- <action method="addJs"><script>craftyclicks/craftyclicks_onepagecheckout.js</script></action>
62
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
63
- </reference>
64
- </onestepcheckout_index_index>
65
-
66
- <gomage_checkout_onepage_index>
67
- <reference name="head">
68
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
69
- <action method="addJs"><script>craftyclicks/craftyclicks_gomage_lightcheckout.js</script></action>
70
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
71
- </reference>
72
- </gomage_checkout_onepage_index>
73
-
74
- <checkout_onestep_index>
75
- <reference name="head">
76
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
77
- <action method="addJs"><script>craftyclicks/craftyclicks_onepagecheckout.js</script></action>
78
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
79
- </reference>
80
- </checkout_onestep_index>
81
-
82
- <ecommerceteam_echeckout_onepage_index>
83
- <reference name="head">
84
- <action method="removeItem"><type>js</type><name>craftyclicks/craftyclicks_magento.js</name></action>
85
- <action method="addJs"><script>craftyclicks/craftyclicks_ecomm_easycheckout.js</script></action>
86
- </reference>
87
- </ecommerceteam_echeckout_onepage_index>
88
-
89
- <wp_onepagecheckout_default>
90
- <reference name="head">
91
- <action method="removeItem"><type>js</type><name>craftyclicks/craftyclicks_magento.js</name></action>
92
- <action method="addJs"><script>craftyclicks/craftyclicks_webandpeople_onepagecheckout.js</script></action>
93
- </reference>
94
- </wp_onepagecheckout_default>
95
-
96
- <onepagecheckout_index_index>
97
- <!-- Interior Web Design (IWD) Free Magento One Step / Page Checkout Module -->
98
- <reference name="head">
99
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
100
- <action method="addJs"><script>craftyclicks/craftyclicks_iwd_onestepcheckout.js</script></action>
101
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
102
- </reference>
103
- </onepagecheckout_index_index>
104
- <opc_index_index>
105
- <!-- IWD Updated their solution, updated corresponding code -->
106
- <reference name="head">
107
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
108
- <action method="addJs"><script>craftyclicks/craftyclicks_iwd_onestepcheckout_v2_2.js</script></action>
109
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
110
- </reference>
111
- </opc_index_index>
112
-
113
- <oscheckout_index_index>
114
- <!-- AHT One Step Checkout - http://www.mage-shop.com/one-step-checkout-extension.html -->
115
- <reference name="head">
116
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
117
- <action method="addJs"><script>craftyclicks/craftyclicks_ath_oscheckout.js</script></action>
118
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
119
- </reference>
120
- </oscheckout_index_index>
121
-
122
- <aw_onestepcheckout_index_index>
123
- <!-- Ahead Works One Step Checkout - http://www.magentocommerce.com/magento-connect/one-step-checkout-by-aheadworks-8829.html -->
124
- <reference name="head">
125
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
126
- <action method="addJs"><script>craftyclicks/craftyclicks_aheadworks_onestepcheckout.js</script></action>
127
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
128
- </reference>
129
- </aw_onestepcheckout_index_index>
130
-
131
- <firecheckout_index_index>
132
- <!-- Tempates Master FireCheckout - http://www.magentocommerce.com/magento-connect/fire-checkout-ultimate-one-page-checkout.html -->
133
- <reference name="head">
134
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
135
- <action method="addJs"><script>craftyclicks/craftyclicks_tm_firecheckout.js</script></action>
136
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
137
- </reference>
138
- </firecheckout_index_index>
139
- <aitcheckout_checkout_index>
140
- <!-- AITOC one step checkout - http://www.aitoc.com/en/one_step_checkout_manager.html -->
141
- <reference name="head">
142
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
143
- <action method="addJs"><script>craftyclicks/craftyclicks_aitoc_checkout.js</script></action>
144
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
145
- </reference>
146
- </aitcheckout_checkout_index>
147
-
148
- <anattadesign_awesomecheckout_onepage_index>
149
- <reference name="head">
150
- <action method="addJs"><script>craftyclicks/crafty_postcode.class.js</script></action>
151
- <action method="addJs"><script>craftyclicks/craftyclicks_awesome_checkout.js</script></action>
152
- <block type="page/html" name="craftyclicks_config" template="craftyclicks/common_config.phtml"/>
153
- </reference>
154
- </anattadesign_awesomecheckout_onepage_index>
155
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/craftyclicks_clicktoaddress.xml ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Crafty Clicks Postcode Lookup
5
+ *
6
+ * @category Extension
7
+ * @copyright Copyright (c) 2009-2013 Crafty Clicks (http://www.craftyclicks.com)
8
+ * @author Crafty Clicks
9
+ */
10
+ -->
11
+
12
+ <layout>
13
+
14
+ <!-- standard magento pages -->
15
+
16
+ <checkout_onepage_index>
17
+ <reference name="head">
18
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
19
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento.js</script></action>
20
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
21
+ </reference>
22
+ </checkout_onepage_index>
23
+
24
+ <checkout_multishipping_customer_address>
25
+ <reference name="head">
26
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
27
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento.js</script></action>
28
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
29
+ </reference>
30
+ </checkout_multishipping_customer_address>
31
+
32
+ <checkout_multishipping_register>
33
+ <reference name="head">
34
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
35
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento.js</script></action>
36
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
37
+ </reference>
38
+ </checkout_multishipping_register>
39
+
40
+ <customer_address_form>
41
+ <reference name="head">
42
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
43
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento.js</script></action>
44
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
45
+ </reference>
46
+ </customer_address_form>
47
+
48
+ <customer_account_create>
49
+ <reference name="head">
50
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
51
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_magento.js</script></action>
52
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
53
+ </reference>
54
+ </customer_account_create>
55
+
56
+ <!-- after-market single page checkout extensions -->
57
+
58
+ <onestepcheckout_index_index>
59
+ <reference name="head">
60
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
61
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_onepagecheckout.js</script></action>
62
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
63
+ </reference>
64
+ </onestepcheckout_index_index>
65
+
66
+ <gomage_checkout_onepage_index>
67
+ <reference name="head">
68
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
69
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_gomage_lightcheckout.js</script></action>
70
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
71
+ </reference>
72
+ </gomage_checkout_onepage_index>
73
+
74
+ <checkout_onestep_index>
75
+ <reference name="head">
76
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
77
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_onepagecheckout.js</script></action>
78
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
79
+ </reference>
80
+ </checkout_onestep_index>
81
+
82
+ <ecommerceteam_echeckout_onepage_index>
83
+ <reference name="head">
84
+ <action method="removeItem"><type>js</type><name>craftyclicks/craftyclicks_magento.js</name></action>
85
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_ecomm_easycheckout.js</script></action>
86
+ </reference>
87
+ </ecommerceteam_echeckout_onepage_index>
88
+
89
+ <wp_onepagecheckout_default>
90
+ <reference name="head">
91
+ <action method="removeItem"><type>js</type><name>craftyclicks/craftyclicks_magento.js</name></action>
92
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_webandpeople_onepagecheckout.js</script></action>
93
+ </reference>
94
+ </wp_onepagecheckout_default>
95
+
96
+ <onepagecheckout_index_index>
97
+ <!-- Interior Web Design (IWD) Free Magento One Step / Page Checkout Module -->
98
+ <reference name="head">
99
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
100
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_iwd_onestepcheckout.js</script></action>
101
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
102
+ </reference>
103
+ </onepagecheckout_index_index>
104
+ <opc_index_index>
105
+ <!-- IWD Updated their solution, updated corresponding code -->
106
+ <reference name="head">
107
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
108
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_iwd_onestepcheckout_v2_2.js</script></action>
109
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
110
+ </reference>
111
+ </opc_index_index>
112
+
113
+ <oscheckout_index_index>
114
+ <!-- AHT One Step Checkout - http://www.mage-shop.com/one-step-checkout-extension.html -->
115
+ <reference name="head">
116
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
117
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_ath_oscheckout.js</script></action>
118
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
119
+ </reference>
120
+ </oscheckout_index_index>
121
+
122
+ <aw_onestepcheckout_index_index>
123
+ <!-- Ahead Works One Step Checkout - http://www.magentocommerce.com/magento-connect/one-step-checkout-by-aheadworks-8829.html -->
124
+ <reference name="head">
125
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
126
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_aheadworks_onestepcheckout.js</script></action>
127
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
128
+ </reference>
129
+ </aw_onestepcheckout_index_index>
130
+
131
+ <firecheckout_index_index>
132
+ <!-- Tempates Master FireCheckout - http://www.magentocommerce.com/magento-connect/fire-checkout-ultimate-one-page-checkout.html -->
133
+ <reference name="head">
134
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
135
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_tm_firecheckout.js</script></action>
136
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
137
+ </reference>
138
+ </firecheckout_index_index>
139
+ <aitcheckout_checkout_index>
140
+ <!-- AITOC one step checkout - http://www.aitoc.com/en/one_step_checkout_manager.html -->
141
+ <reference name="head">
142
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
143
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_aitoc_checkout.js</script></action>
144
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
145
+ </reference>
146
+ </aitcheckout_checkout_index>
147
+
148
+ <anattadesign_awesomecheckout_onepage_index>
149
+ <reference name="head">
150
+ <action method="addJs"><script>craftyclicks/clicktoaddress/crafty_postcode.class.js</script></action>
151
+ <action method="addJs"><script>craftyclicks/clicktoaddress/craftyclicks_awesome_checkout.js</script></action>
152
+ <block type="page/html" name="craftyclicks_config" template="craftyclicks/clicktoaddress/common_config.phtml"/>
153
+ </reference>
154
+ </anattadesign_awesomecheckout_onepage_index>
155
+ </layout>
app/design/frontend/base/default/template/craftyclicks/clicktoaddress/common_config.phtml ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $conf = Mage::getStoreConfig('clicktoaddress/general');
4
+
5
+ $js_config = "";
6
+
7
+ if (1 == $conf['active']) {
8
+
9
+ /* ---------------------------------------------------------------------------
10
+ This is a workaround for Amestys lack of hookable layout tag.
11
+ --------------------------------------------------------------------------- */
12
+ $ams = Mage::getStoreConfig('amscheckout');
13
+ if (isset($ams)){
14
+ $js_config .= " var _cp_integrate = false;";
15
+ $js_config .= " var _cp_integrate_amesty = true;";
16
+ echo '<script src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS).'craftyclicks/craftyclicks_amesty_onepagecheckout.js"></script>';
17
+ }
18
+ else{
19
+ $js_config .= " var _cp_integrate = true;";
20
+ }
21
+ $js_config.= " var _cp_enable_for_uk_only = true;"; // if true, the button will show up only for UK
22
+ if (array_key_exists('button_image',$conf) && '' != $conf['button_image']) {
23
+ $js_config.= " var _cp_button_image = '".$this->getSkinUrl('images/craftyclicks/'.$conf['button_image'])."';";
24
+ } else {
25
+ $js_config.= " var _cp_button_image = '';";
26
+ }
27
+ $js_config.= " var _cp_button_text = 'Find Address';";
28
+ $js_config.= " var _cp_button_class = '".$conf['button_class']."';";
29
+ $js_config.= " var _cp_result_box_height = '".$conf['max_res_lines']."';"; // number of lines to show in result box, must be 1 or more
30
+ $js_config.= " var _cp_result_box_width = '';"; // width of the result box
31
+ $js_config.= " var _cp_busy_img_url = '".$this->getSkinUrl('images/craftyclicks/clicktoaddress/'."crafty_postcode_busy.gif")."';"; // the url of the image to show while waiting for lookup results, e.g. a spinning wheel etc.
32
+
33
+ if (array_key_exists('clear_result',$conf) && $conf['clear_result']) {
34
+ $js_config.= " var _cp_clear_result = true;";
35
+ } else {
36
+ $js_config.= " var _cp_clear_result = false;";
37
+ }
38
+
39
+ $js_config.= " var _cp_hide_result = true;"; // once users make the selection, hide the result box - true/false
40
+ $js_config.= " var _cp_1st_res_line = '".$conf['first_res_line']."';";
41
+ $js_config.= " var _cp_err_msg1 = '".$conf['error_msg_1']."';";
42
+ $js_config.= " var _cp_err_msg2 = '".$conf['error_msg_2']."';";
43
+ $js_config.= " var _cp_err_msg3 = '".$conf['error_msg_3']."';";
44
+ $js_config.= " var _cp_err_msg4 = '".$conf['error_msg_4']."';";
45
+ $js_config.= " var _cp_token_fe = '".$conf['access_token']."';";
46
+
47
+ if (array_key_exists('hide_fields',$conf) && $conf['hide_fields']) {
48
+ $js_config.= " var _cp_hide_fields = true;";
49
+ } else {
50
+ $js_config.= " var _cp_hide_fields = false;";
51
+ }
52
+
53
+ if (array_key_exists('hide_county',$conf) && $conf['hide_county']) {
54
+ $js_config.= " var _cp_hide_county = true;";
55
+ } else {
56
+ $js_config.= " var _cp_hide_county = false;";
57
+ }
58
+
59
+ if (array_key_exists('error_class',$conf) && '' != $conf['error_class']) {
60
+ $js_config.= " var _cp_error_class = '".$conf['error_class']."';";
61
+ } else {
62
+ $js_config.= " var _cp_error_class = '';";
63
+ }
64
+
65
+ if (array_key_exists('move_fields',$conf) && $conf['move_fields']) {
66
+ $js_config.= " var _cp_move_fields = true;";
67
+ } else {
68
+ $js_config.= " var _cp_move_fields = false;";
69
+ }
70
+ if (array_key_exists('button_fixposition',$conf) && 1 == $conf['button_fixposition']) {
71
+ $js_config.= " var _cp_button_fixposition = true;";
72
+ } else {
73
+ $js_config.= " var _cp_button_fixposition = false;";
74
+ }
75
+
76
+ } else { //if (1 == $conf['active']) {
77
+ $js_config = " var _cp_integrate = false; ";
78
+ }
79
+ ?>
80
+
81
+ <script type="text/javascript">
82
+ //<![CDATA[
83
+ <?php echo $js_config; ?>
84
+ //]]>
85
+ </script>
86
+
87
+
app/design/frontend/base/default/template/craftyclicks/common_config.phtml DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
- $conf = Mage::getStoreConfig('general');
4
- $js_config = "";
5
-
6
- if (1 == $conf['craftyclicks']['active']) {
7
-
8
- /* ---------------------------------------------------------------------------
9
- This is a workaround for Amestys lack of hookable layout tag.
10
- --------------------------------------------------------------------------- */
11
- $ams = Mage::getStoreConfig('amscheckout');
12
- if (isset($ams)){
13
- $js_config .= " var _cp_integrate = false;";
14
- $js_config .= " var _cp_integrate_amesty = true;";
15
- echo '<script src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS).'craftyclicks/craftyclicks_amesty_onepagecheckout.js"></script>';
16
- }
17
- else{
18
- $js_config .= " var _cp_integrate = true;";
19
- }
20
- $js_config.= " var _cp_enable_for_uk_only = true;"; // if true, the button will show up only for UK
21
- if (array_key_exists('button_image',$conf['craftyclicks']) && '' != $conf['craftyclicks']['button_image']) {
22
- $js_config.= " var _cp_button_image = '".$this->getSkinUrl('images/craftyclicks/'.$conf['craftyclicks']['button_image'])."';";
23
- } else {
24
- $js_config.= " var _cp_button_image = '';";
25
- }
26
- $js_config.= " var _cp_button_text = 'Find Address';";
27
- $js_config.= " var _cp_button_class = '".$conf['craftyclicks']['button_class']."';";
28
- $js_config.= " var _cp_result_box_height = '".$conf['craftyclicks']['max_res_lines']."';"; // number of lines to show in result box, must be 1 or more
29
- $js_config.= " var _cp_result_box_width = '';"; // width of the result box
30
- $js_config.= " var _cp_busy_img_url = '".$this->getSkinUrl('images/craftyclicks/'."crafty_postcode_busy.gif")."';"; // the url of the image to show while waiting for lookup results, e.g. a spinning wheel etc.
31
-
32
- if (array_key_exists('clear_result',$conf['craftyclicks']) && $conf['craftyclicks']['clear_result']) {
33
- $js_config.= " var _cp_clear_result = true;";
34
- } else {
35
- $js_config.= " var _cp_clear_result = false;";
36
- }
37
-
38
- $js_config.= " var _cp_hide_result = true;"; // once users make the selection, hide the result box - true/false
39
- $js_config.= " var _cp_1st_res_line = '".$conf['craftyclicks']['first_res_line']."';";
40
- $js_config.= " var _cp_err_msg1 = '".$conf['craftyclicks']['error_msg_1']."';";
41
- $js_config.= " var _cp_err_msg2 = '".$conf['craftyclicks']['error_msg_2']."';";
42
- $js_config.= " var _cp_err_msg3 = '".$conf['craftyclicks']['error_msg_3']."';";
43
- $js_config.= " var _cp_err_msg4 = '".$conf['craftyclicks']['error_msg_4']."';";
44
- $js_config.= " var _cp_token_fe = '".$conf['craftyclicks']['access_token']."';";
45
-
46
- if (array_key_exists('hide_fields',$conf['craftyclicks']) && $conf['craftyclicks']['hide_fields']) {
47
- $js_config.= " var _cp_hide_fields = true;";
48
- } else {
49
- $js_config.= " var _cp_hide_fields = false;";
50
- }
51
-
52
- if (array_key_exists('hide_county',$conf['craftyclicks']) && $conf['craftyclicks']['hide_county']) {
53
- $js_config.= " var _cp_hide_county = true;";
54
- } else {
55
- $js_config.= " var _cp_hide_county = false;";
56
- }
57
-
58
- if (array_key_exists('error_class',$conf['craftyclicks']) && '' != $conf['craftyclicks']['error_class']) {
59
- $js_config.= " var _cp_error_class = '".$conf['craftyclicks']['error_class']."';";
60
- } else {
61
- $js_config.= " var _cp_error_class = '';";
62
- }
63
-
64
- if (array_key_exists('move_fields',$conf['craftyclicks']) && $conf['craftyclicks']['move_fields']) {
65
- $js_config.= " var _cp_move_fields = true;";
66
- } else {
67
- $js_config.= " var _cp_move_fields = false;";
68
- }
69
- if (array_key_exists('button_fixposition',$conf['craftyclicks']) && 1 == $conf['craftyclicks']['button_fixposition']) {
70
- $js_config.= " var _cp_button_fixposition = true;";
71
- } else {
72
- $js_config.= " var _cp_button_fixposition = false;";
73
- }
74
-
75
- } else { //if (1 == $conf['craftyclicks']['active']) {
76
- $js_config = " var _cp_integrate = false; ";
77
- }
78
- ?>
79
-
80
- <script type="text/javascript">
81
- //<![CDATA[
82
- <?php echo $js_config; ?>
83
- //]]>
84
- </script>
85
-
86
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/CraftyClicks.xml CHANGED
@@ -2,9 +2,8 @@
2
  <config>
3
  <modules>
4
  <CraftyClicks>
5
- <active>true</active>
6
  <codePool>local</codePool>
7
- <version>2.4.8</version>
8
  </CraftyClicks>
9
  </modules>
10
  </config>
2
  <config>
3
  <modules>
4
  <CraftyClicks>
5
+ <active>false</active>
6
  <codePool>local</codePool>
 
7
  </CraftyClicks>
8
  </modules>
9
  </config>
app/etc/modules/Craftyclicks_Clicktoaddress.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Craftyclicks_Clicktoaddress>
6
+ <active>true</active>
7
+ <codePool>community</codePool>
8
+ </Craftyclicks_Clicktoaddress>
9
+ </modules>
10
+ </config>
js/craftyclicks/{crafty_postcode.class.js → clicktoaddress/crafty_postcode.class.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_aheadworks_onestepcheckout.js → clicktoaddress/craftyclicks_aheadworks_onestepcheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_aitoc_checkout.js → clicktoaddress/craftyclicks_aitoc_checkout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_amesty_onepagecheckout.js → clicktoaddress/craftyclicks_amesty_onepagecheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_ath_oscheckout.js → clicktoaddress/craftyclicks_ath_oscheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_awesome_checkout.js → clicktoaddress/craftyclicks_awesome_checkout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_ecomm_easycheckout.js → clicktoaddress/craftyclicks_ecomm_easycheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_gomage_lightcheckout.js → clicktoaddress/craftyclicks_gomage_lightcheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_iwd_onestepcheckout.js → clicktoaddress/craftyclicks_iwd_onestepcheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_iwd_onestepcheckout_v2_2.js → clicktoaddress/craftyclicks_iwd_onestepcheckout_v2_2.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_magento.js → clicktoaddress/craftyclicks_magento.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_magento_admin.js → clicktoaddress/craftyclicks_magento_admin.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_onepagecheckout.js → clicktoaddress/craftyclicks_onepagecheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_tm_firecheckout.js → clicktoaddress/craftyclicks_tm_firecheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_vinagentocheckout.js → clicktoaddress/craftyclicks_vinagentocheckout.js} RENAMED
File without changes
js/craftyclicks/{craftyclicks_webandpeople_onepagecheckout.js → clicktoaddress/craftyclicks_webandpeople_onepagecheckout.js} RENAMED
File without changes
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>UK_Postcode_Address_Finder</name>
4
- <version>2.4.9</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -15,6 +15,9 @@ UK address entry is greatly speeded up thus improving the user experience. The b
15
  &#xD;
16
  The extension is free to try and install, but to go live a paid up account with Crafty Clicks will be required. For current prices please go to http://www.craftyclicks.co.uk/paf-database-pricing</description>
17
  <notes>Release History&#xD;
 
 
 
18
  v2.4.9&#xD;
19
  * Added support for Awesome Checkout&#xD;
20
  &#xD;
@@ -133,9 +136,9 @@ v 1.1.0 &#xD;
133
  &#xD;
134
  v 1.0.0 - Initial Release</notes>
135
  <authors><author><name>Crafty Clicks</name><user>styloa</user><email>support@craftyclicks.co.uk</email></author></authors>
136
- <date>2014-09-15</date>
137
- <time>19:09:24</time>
138
- <contents><target name="mage"><dir name="app"><dir name="code"><dir name="local"><dir name="CraftyClicks"><dir name="Helper"><file name="Data.php" hash="e5f75947ad629aabb2e3cbcde412e2cc"/></dir><dir name="etc"><file name="config.xml" hash="d25a6a33c3a92dcddc04197859323240"/><file name="system.xml" hash="dddb7095040104cde614e322bb40636e"/></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="CraftyClicks.xml" hash="f6644a9ea28f2b7dff329c4731b8473d"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="craftyclicks"><file name="common_config.phtml" hash="3c663645e65dd5b2efbc329876032856"/></dir></dir><dir name="layout"><file name="craftyclicks.xml" hash="b825fe5968b19ba08c72bee8b7082904"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="craftyclicks.xml" hash="d78755c653604a6f969bf289e4a109b5"/></dir><dir name="template"><dir name="craftyclicks"><file name="common_config.phtml" hash="e1bb4493d4c35f46a1d3cfe60d503d97"/></dir></dir></dir></dir></dir></dir></dir><dir name="js"><dir name="craftyclicks"><file name="crafty_postcode.class.js" hash="44593e9ea50fbfb6a6a35760b878331f"/><file name="craftyclicks_aheadworks_onestepcheckout.js" hash="cf50ea20ebf90c128684a18297a232d6"/><file name="craftyclicks_aitoc_checkout.js" hash="c92b1d13b6292a64cdb6851e171ec329"/><file name="craftyclicks_amesty_onepagecheckout.js" hash="5d9e0aef9e1b92a99ba3ea49f57bf169"/><file name="craftyclicks_ath_oscheckout.js" hash="a4fd82428db4635f1e2937ac129e1900"/><file name="craftyclicks_awesome_checkout.js" hash="94a3fc551eca17e227c4524e2eb5a397"/><file name="craftyclicks_ecomm_easycheckout.js" hash="728e1c3cf223f484f7b9050e84d34c10"/><file name="craftyclicks_gomage_lightcheckout.js" hash="a5c0b20eb5295c5e4561d55019d625a7"/><file name="craftyclicks_iwd_onestepcheckout.js" hash="69053cfee63961ecaced8672bf2386b5"/><file name="craftyclicks_iwd_onestepcheckout_v2_2.js" hash="ee241c97833fb0f24cf9e26ec80523bb"/><file name="craftyclicks_magento.js" hash="9a48ef8a5ba1bbbc4ae7de09468129c7"/><file name="craftyclicks_magento_admin.js" hash="75f3078d1d678a5813b66b439409679b"/><file name="craftyclicks_onepagecheckout.js" hash="2be54032160205ab7c5fe3e5bdd4d601"/><file name="craftyclicks_tm_firecheckout.js" hash="c469e57c3de18cbddbcc6fa30661d2da"/><file name="craftyclicks_vinagentocheckout.js" hash="250b2f05677fbf17f847b57ae2c50993"/><file name="craftyclicks_webandpeople_onepagecheckout.js" hash="7a9d5c9cf6b341e6e6102e38593bad81"/></dir></dir><dir name="skin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="craftyclicks"><file name="button_find_address.gif" hash="0fdef9bf7ad0f7ec3f6530b7ff40bf59"/><file name="crafty_postcode_busy.gif" hash="618a14f4dca4f51100cd2400e7f9049c"/></dir></dir></dir></dir></dir></dir></target></contents>
139
  <compatible/>
140
  <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
141
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>UK_Postcode_Address_Finder</name>
4
+ <version>2.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
15
  &#xD;
16
  The extension is free to try and install, but to go live a paid up account with Crafty Clicks will be required. For current prices please go to http://www.craftyclicks.co.uk/paf-database-pricing</description>
17
  <notes>Release History&#xD;
18
+ v2.5.0&#xD;
19
+ * Major Code Rework.&#xD;
20
+ &#xD;
21
  v2.4.9&#xD;
22
  * Added support for Awesome Checkout&#xD;
23
  &#xD;
136
  &#xD;
137
  v 1.0.0 - Initial Release</notes>
138
  <authors><author><name>Crafty Clicks</name><user>styloa</user><email>support@craftyclicks.co.uk</email></author></authors>
139
+ <date>2014-10-22</date>
140
+ <time>13:04:30</time>
141
+ <contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Craftyclicks"><dir name="Clicktoaddress"><dir name="Helper"><file name="Data.php" hash="a561b9307d3a038e91d32c232820f54d"/></dir><dir name="data"><dir name="craftyclicks_clicktoaddress_setup"><file name="data-upgrade-2.4.9-2.5.0.php" hash="580589f5aff53b041773886008b23743"/></dir></dir><dir name="etc"><file name="config.xml" hash="0c5bc19b47d0ccecd365998bc4d77056"/><file name="system.xml" hash="9ab78f3e038966c6c147932367a3586b"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Craftyclicks_Clicktoaddress.xml" hash="66e9933c58e73eaebf95266ea67b11bc"/><file name="CraftyClicks.xml" hash="34ceb62bbcd46b57947d369bf58737a1"/></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="craftyclicks_clicktoaddress.xml" hash="76a352b24809cb433f0dfe0beadb4144"/></dir><dir name="template"><dir name="craftyclicks"><dir name="clicktoaddress"><file name="common_config.phtml" hash="bc9f6d79823de2de877c452aca5a96fe"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir><dir name="layout"><file name="craftyclicks_clicktoaddress.xml" hash="3801f3855fea8ebf8a085e968b46b16d"/></dir></dir><dir name="template"><dir name="craftyclicks"><dir name="clicktoaddress"><file name="common_config.phtml" hash="10a175ec47a3dcff7e2119c86e7c70af"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="js"><dir name="craftyclicks"><dir name="clicktoaddress"><file name="crafty_postcode.class.js" hash="44593e9ea50fbfb6a6a35760b878331f"/><file name="craftyclicks_aheadworks_onestepcheckout.js" hash="cf50ea20ebf90c128684a18297a232d6"/><file name="craftyclicks_aitoc_checkout.js" hash="c92b1d13b6292a64cdb6851e171ec329"/><file name="craftyclicks_amesty_onepagecheckout.js" hash="5d9e0aef9e1b92a99ba3ea49f57bf169"/><file name="craftyclicks_ath_oscheckout.js" hash="a4fd82428db4635f1e2937ac129e1900"/><file name="craftyclicks_awesome_checkout.js" hash="94a3fc551eca17e227c4524e2eb5a397"/><file name="craftyclicks_ecomm_easycheckout.js" hash="728e1c3cf223f484f7b9050e84d34c10"/><file name="craftyclicks_gomage_lightcheckout.js" hash="a5c0b20eb5295c5e4561d55019d625a7"/><file name="craftyclicks_iwd_onestepcheckout.js" hash="69053cfee63961ecaced8672bf2386b5"/><file name="craftyclicks_iwd_onestepcheckout_v2_2.js" hash="ee241c97833fb0f24cf9e26ec80523bb"/><file name="craftyclicks_magento.js" hash="9a48ef8a5ba1bbbc4ae7de09468129c7"/><file name="craftyclicks_magento_admin.js" hash="75f3078d1d678a5813b66b439409679b"/><file name="craftyclicks_onepagecheckout.js" hash="2be54032160205ab7c5fe3e5bdd4d601"/><file name="craftyclicks_tm_firecheckout.js" hash="c469e57c3de18cbddbcc6fa30661d2da"/><file name="craftyclicks_vinagentocheckout.js" hash="250b2f05677fbf17f847b57ae2c50993"/><file name="craftyclicks_webandpeople_onepagecheckout.js" hash="7a9d5c9cf6b341e6e6102e38593bad81"/></dir></dir></dir><dir name="skin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="craftyclicks"><dir name="clicktoaddress"><file name="button_find_address.gif" hash="0fdef9bf7ad0f7ec3f6530b7ff40bf59"/><file name="crafty_postcode_busy.gif" hash="618a14f4dca4f51100cd2400e7f9049c"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
142
  <compatible/>
143
  <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
144
  </package>
skin/frontend/base/default/images/craftyclicks/{button_find_address.gif → clicktoaddress/button_find_address.gif} RENAMED
File without changes
skin/frontend/base/default/images/craftyclicks/{crafty_postcode_busy.gif → clicktoaddress/crafty_postcode_busy.gif} RENAMED
File without changes