Melissa_Plugin - Version 1.2.5

Version Notes

Download this release

Release Info

Developer Sebastian Enger
Extension Melissa_Plugin
Version 1.2.5
Comparing to
See all releases


Code changes from version 1.2.4 to 1.2.5

app/code/local/Melissa/Plugin/Helper/Data.php~ ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Melissa_Plugin_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+ ?>
app/code/local/Melissa/Plugin/controllers/IndexController.php~ ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Melissa_Plugin_IndexController extends Mage_Core_Controller_Front_Action{
3
+ public function indexAction(){
4
+ $this->loadLayout();
5
+ $this->renderLayout();
6
+ }
7
+ public function mamethodeAction(){
8
+ echo ‘test mamethode’;
9
+ }
10
+ }
11
+ ?>
app/code/local/Melissa/Plugin/etc/config.xml CHANGED
@@ -6,14 +6,14 @@ Melissa Data Plugin for Magento: Config XML Library
6
  Author: Sebastian Enger, M.Sc. //"Liebe besiegt Alles".
7
  Contact: Sebastian.Enger@MelissaData.com
8
  Phone: +49 30 80 933 178-2
9
- Last Modified: 2016-08-17//11:30pm
10
  */
11
  -->
12
 
13
  <config>
14
  <modules>
15
  <Melissa_Plugin>
16
- <version>1.2.4</version>
17
  <depends>
18
  <!-- no dependencies -->
19
  </depends>
@@ -22,7 +22,7 @@ Last Modified: 2016-08-17//11:30pm
22
  <default>
23
  <catalog>
24
  <backend>
25
- <version>1.2.4</version>
26
  <gaws>1</gaws>
27
  <gee>1</gee>
28
  <email>1</email>
6
  Author: Sebastian Enger, M.Sc. //"Liebe besiegt Alles".
7
  Contact: Sebastian.Enger@MelissaData.com
8
  Phone: +49 30 80 933 178-2
9
+ Last Modified: 2016-09-05//11:30pm
10
  */
11
  -->
12
 
13
  <config>
14
  <modules>
15
  <Melissa_Plugin>
16
+ <version>1.2.5</version>
17
  <depends>
18
  <!-- no dependencies -->
19
  </depends>
22
  <default>
23
  <catalog>
24
  <backend>
25
+ <version>1.2.5</version>
26
  <gaws>1</gaws>
27
  <gee>1</gee>
28
  <email>1</email>
app/code/local/Melissa/Plugin/etc/config.xml~ ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <!--
4
+ /**
5
+ * Melissa Data - Magento Plugin
6
+ *
7
+ * @category MelissaData
8
+ * @package MelissaData
9
+ * @copyright MelissaData.com
10
+ * @copyright 2016 - Sebastian Enger / Melissa Data
11
+ */
12
+ -->
13
+
14
+ <config>
15
+ <modules>
16
+ <Melissa_Plugin>
17
+ <version>1.0.0</version>
18
+ </Melissa_Plugin>
19
+ </modules>
20
+
21
+ <frontend>
22
+ <layout>
23
+ <updates>
24
+ <show_melissaglobaladdress module="Melissa_Plugin">
25
+ <file>show_melissaglobaladdress.xml</file>
26
+ </show_melissaglobaladdress>
27
+ </updates>
28
+ </layout>
29
+ <routers>
30
+ <melissaglobaladdress>
31
+ <use>standard</use>
32
+ <args>
33
+ <module>Melissa_Plugin</module>
34
+ <frontName>melissaglobaladdress</frontName>
35
+ </args>
36
+ </melissaglobaladdress>
37
+ </routers>
38
+ </frontend>
39
+ <!--
40
+ <frontend>
41
+ <layout>
42
+ <updates>
43
+ <melissa_plugin module="Melissa_Plugin">
44
+ <file>layout.xml</file>
45
+ </melissa_plugin>
46
+ </updates>
47
+ </layout>
48
+ </frontend>
49
+ -->
50
+ </config>
app/code/local/Melissa/Plugin/etc/system.xml CHANGED
@@ -5,7 +5,7 @@ Melissa Data Plugin for Magento: System XML Library
5
  Author: Sebastian Enger, M.Sc. //"Liebe besiegt Alles".
6
  Contact: Sebastian.Enger@MelissaData.com
7
  Phone: +49 30 80 933 178-2
8
- Last Modified: 2016-08-17//11:30pm
9
  */
10
  -->
11
  <config>
5
  Author: Sebastian Enger, M.Sc. //"Liebe besiegt Alles".
6
  Contact: Sebastian.Enger@MelissaData.com
7
  Phone: +49 30 80 933 178-2
8
+ Last Modified: 2016-09-05//11:30pm
9
  */
10
  -->
11
  <config>
app/design/frontend/base/default/layout/layout.xml~ ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Global Layout Overrides to add custom structure blocks to layout template files
5
+ *
6
+ * @category My
7
+ * @package My_LayoutMods
8
+ * @copyright Copyright (c) 2013 August Ash, Inc. (http://www.augustash.com)
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ */
11
+ -->
12
+ <layout version="0.1.0">
13
+ <!--==============================================
14
+ Default layout, loads most of the pages
15
+ ===============================================-->
16
+ <default>
17
+ <reference name="root">
18
+ <!-- <block type="core/template" name="custom_title" template="page/melissa_plugin.phtml" /> --> <!-- Token Server Support -->
19
+ <block type="core/text_list" name="newreference" as="newreference"/>
20
+ </reference>
21
+ <reference name="newreference">
22
+ <block type="core/template" name="newReferenceBlock" template="page/melissa_plugin.phtml" />
23
+ </reference>
24
+ </default>
25
+ <!--==============================================
26
+ END Default
27
+ ===============================================-->
28
+ </layout>
29
+
30
+
app/design/frontend/base/default/layout/local.xml~ ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="1.0.0">
3
+ <default>
4
+ <reference name="head">
5
+ <!-- <action method="addJs"><script>melissadata/jquery.min.js</script></action> -->
6
+ <!-- <action method="addJs"><script>melissadata/jquery-ui.min.js</script></action> -->
7
+ <!-- <action method="addJs"><script>melissadata/js.cookie.min.js</script></action> -->
8
+ <action method="addJs">
9
+ <script>melissadata/Magento.js</script>
10
+ <params><![CDATA[name="js9999_last"]]></params>
11
+ </action>
12
+ </reference>
13
+ <!--
14
+ <reference name="root">
15
+ <block type="core/text_list" name="newreference" as="newreference"/>
16
+ </reference>
17
+ <reference name="newreference">
18
+ <block type="core/template" name="newReferenceBlock" template="page/melissa_plugin.phtml" />
19
+ </reference>
20
+ -->
21
+ </default>
22
+ </layout>
app/design/frontend/base/default/layout/my_layoutmods.xml~ ADDED
File without changes
app/design/frontend/base/default/layout/page.xml~ ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Global Layout Overrides to add custom structure blocks to layout template files
5
+ *
6
+ * @category My
7
+ * @package My_LayoutMods
8
+ * @copyright Copyright (c) 2013 August Ash, Inc. (http://www.augustash.com)
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ */
11
+ -->
12
+ <layout version="0.1.0">
13
+ <!--==============================================
14
+ Default layout, loads most of the pages
15
+ ===============================================-->
16
+ <default>
17
+ <reference name="root">
18
+ <block type="core/template" name="custom_title" template="page/melissa_plugin.phtml" /> <!-- Token Server Support -->
19
+ </reference>
20
+ </default>
21
+ <!--==============================================
22
+ END Default
23
+ ===============================================-->
24
+ </layout>
25
+
26
+
app/design/frontend/base/default/layout/show_melissaglobaladdress.xml~ ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *
5
+ * @category Extension
6
+ * @copyright Copyright (c) 2009-2015 Crafty Clicks (https://craftyclicks.co.uk)
7
+ * @author Sebastian Enger / Melissa Data / MelissaData.com
8
+ */
9
+ -->
10
+
11
+ <layout>
12
+ <!-- Ajax Time -->
13
+ <!- <melissaglobaladdress_ajax_index>
14
+ <block type="melissaglobaladdress/ajaxblock" name="root" template="page/melissa_plugin.phtml" />
15
+ </melissaglobaladdress_ajax_index> -->
16
+ <!-- after checkout validation -->
17
+ <!--
18
+ <checkout_onepage_success>
19
+ <reference name="head">
20
+ <block type="page/html" name="cc_melissa_postcheck" template="craftyclicks/melissaglobaladdress/post_checkout.phtml"/>
21
+ </reference>
22
+ </checkout_onepage_success>
23
+ -->
24
+ <!-- checkout/registration autocomplete -->
25
+ <!--
26
+ <checkout_onepage_index>
27
+ <reference name="head">
28
+ <action method="addJs"><script>craftyclicks/melissaglobaladdress/melissadata_magento.js</script></action>
29
+ <action method="addCss"><stylesheet>css/craftyclicks/melissaglobaladdress/melissa_autocomplete.css</stylesheet></action>
30
+ <block type="page/html" name="cc_melissa_config" template="craftyclicks/melissaglobaladdress/common_config.phtml"/>
31
+ </reference>
32
+ </checkout_onepage_index>
33
+ -->
34
+ </layout>
app/design/frontend/base/default/layout/test.xml~ ADDED
File without changes
app/design/frontend/base/default/template/afficher.phtml~ ADDED
File without changes
app/design/frontend/base/default/template/page/melissa_plugin.phtml CHANGED
@@ -9,13 +9,21 @@ Last Modified: 2016-08-17//11:30pm
9
 
10
  /*
11
  $states = Mage::getModel('directory/country')->load("CA")->getRegions()->toOptionArray();
 
12
  $arr = array();
13
  $t_arr = array();
14
  foreach($states as $region){
15
- array_push($arr, $region['title']."#".$region['value']);
16
  }
17
 
 
 
18
  print_r($states);
 
 
 
 
 
19
 
20
  setcookie('states_CA_Collection', '', time()-300);
21
  setcookie('states_CA_Collection', json_encode($arr), time() + 86400, "/");
9
 
10
  /*
11
  $states = Mage::getModel('directory/country')->load("CA")->getRegions()->toOptionArray();
12
+
13
  $arr = array();
14
  $t_arr = array();
15
  foreach($states as $region){
16
+ array_push($arr, $region['title']."=>".$region['value']);
17
  }
18
 
19
+ echo "Raw dump: <br /><br />";
20
+ echo "<pre>";
21
  print_r($states);
22
+ echo "</pre>";
23
+
24
+ echo "<br /><br />Canadian Regions dump: <br /><br />";
25
+ print_r($arr);
26
+
27
 
28
  setcookie('states_CA_Collection', '', time()-300);
29
  setcookie('states_CA_Collection', json_encode($arr), time() + 86400, "/");
app/design/frontend/base/default/template/page/melissa_plugin.phtml~ ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Melissa Data Plugin for Magento
4
+ Author: Sebastian Enger
5
+ Contact: Sebastian.Enger@MelissaData.com
6
+ Phone: +49 30 80 933 178-2
7
+ Last Modified: 2016-06-03::12am
8
+ */
9
+
10
+ /*
11
+ $1 = Mage::getStoreConfig('melissa_plugin/customerid'); // get Melissa Data customer ID
12
+
13
+ $2 = Mage::getStoreConfig('melissa_plugin/singlerow_enabled'); // enable Single Row Autocompletion?
14
+ $3 = Mage::getStoreConfig('melissa_plugin/fielded_enabled'); // enable Fielded Autocompletion?
15
+
16
+ $4 = Mage::getStoreConfig('melissa_plugin/singlerow_countries'); // define singlerow countries
17
+ $3 = Mage::getStoreConfig('melissa_plugin/fielded_countries'); // define fielded countries
18
+
19
+ $4 = Mage::getStoreConfig('melissa_plugin/service_gaws_enabled'); // enable Address Verification?
20
+ $3 = Mage::getStoreConfig('melissa_plugin/service_gee_enabled'); // enable Autocompletion?
21
+ $4 = Mage::getStoreConfig('melissa_plugin/service_email_enabled'); // enable Email Check?
22
+ $4 = Mage::getStoreConfig('melissa_plugin/service_phone_enabled'); // enable Phone Check?
23
+
24
+ $4 = Mage::getStoreConfig('melissa_plugin/service_email_premium_enabled'); // enable Email Premium Check?
25
+ $4 = Mage::getStoreConfig('melissa_plugin/service_phone_premium_enabled'); // enable Phone Premium Check?
26
+ */
27
+
28
+ $customer_id = "111466882"; // Melissa Data Customer ID of Sebastian Enger
29
+
30
+ $intEmail = "pkgIntEmail"; // email token server option
31
+ $intName = "pkgIntNameCheck"; // name token server option
32
+ $intPhone = "pkgIntPhoneCheck"; // phone token server option
33
+ $intGAddr = "pkgIntAddressCheck"; // gaws address token server option
34
+ $intGeo = "pkgIntGeoCode"; // geocode token server option
35
+ $intGee = "pkgExpressEntry"; // gee token server option
36
+ $myGeoGawsOption = $intGAddr+","+$intGeo;
37
+
38
+ // set the Token Server HTTPS endpoint
39
+ $TokenServerEndpoint = "https://token.melissadata.net/v3/WEB/service.svc/RequestToken?L=".$customer_id;
40
+
41
+ // build the request uri for the separate tokens
42
+ $TokenReqGee = $TokenServerEndpoint."&P=".$intGee;
43
+ $TokenReqGaws = $TokenServerEndpoint."&P=".$intGAddr;
44
+
45
+ // get the GEE token XML content
46
+ $TokenContentGee = url_get_contents($TokenReqGee);
47
+ $tokenGeeRaw = new SimpleXMLElement($TokenContentGee);
48
+
49
+ // store the reals GEE Token Content as string
50
+ $tokenGee = (string)$tokenGeeRaw->Token;
51
+
52
+ // get the GAWS token XML content
53
+ $TokenContentGaws = url_get_contents($TokenReqGaws);
54
+ $tokenGawsRaw = new SimpleXMLElement($TokenContentGaws);
55
+
56
+ // store the reals GAWS Token Content as string
57
+ $tokenGaws = (string)$tokenGawsRaw->Token;
58
+
59
+ setcookie('MelissaDataMagento_GEE_Token', $tokenGee, time() + (86400 * 0.75), "/"); // 80400 = 0.75 day
60
+ setcookie('MelissaDataMagento_GAWS_Token', $tokenGaws, time() + (86400 * 30), "/"); // 80400 = 0.75 day
61
+
62
+ $date = date('m/d/Y h:i:s a', time());
63
+ file_put_contents("/tmp/md_tokenserver.log", "$date :: tokensever request sent to GAWS & GEE: $tokenGaws\n", FILE_APPEND | LOCK_EX);
64
+
65
+ /*
66
+ echo <<<END
67
+ <script>
68
+ alert('<?php echo "$tokenGee"; ?>');
69
+ </script>
70
+ <script>
71
+ //alert("token server gaws kommt"+$tokenGaws);
72
+ console.log("token from Token Server MD Backend:"+$tokenGee);
73
+ </script>
74
+ END;
75
+ */
76
+
77
+ function url_get_contents ($url) {
78
+ if (function_exists('curl_exec')){
79
+ $url_get_contents_data = get_web_page( $url );
80
+ }elseif(function_exists('file_get_contents')){
81
+ $url_get_contents_data = file_get_contents($url);
82
+ }elseif(function_exists('fopen') && function_exists('stream_get_contents')){
83
+ $handle = fopen ($url, "r");
84
+ $url_get_contents_data = stream_get_contents($handle);
85
+ }else{
86
+ $url_get_contents_data = false;
87
+ }
88
+ return $url_get_contents_data;
89
+ } // function url_get_contents ($url) {
90
+
91
+
92
+ function get_web_page( $url ){
93
+ $options = array(
94
+ CURLOPT_RETURNTRANSFER => true, // return web page
95
+ CURLOPT_HEADER => false, // don't return headers
96
+ CURLOPT_FOLLOWLOCATION => true, // follow redirects
97
+ CURLOPT_ENCODING => "utf-8", // handle all encodings
98
+ CURLOPT_USERAGENT => "Magento Plugin/MelissaData/TokenServerAccess/v0.0.1", // who am i
99
+ CURLOPT_AUTOREFERER => true, // set referer on redirect
100
+ CURLOPT_CONNECTTIMEOUT => 3, // timeout on connect
101
+ CURLOPT_TIMEOUT => 3, // timeout on response
102
+ CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
103
+ CURLOPT_SSL_VERIFYPEER => true, // Enable SSL Cert checks
104
+ );
105
+
106
+ $ch = curl_init( $url );
107
+ curl_setopt_array( $ch, $options );
108
+ $content = curl_exec( $ch );
109
+ $err = curl_errno( $ch );
110
+ $errmsg = curl_error( $ch );
111
+ $header = curl_getinfo( $ch );
112
+ curl_close( $ch );
113
+ return $content;
114
+ }
115
+
116
+
117
+ ?>
app/etc/modules/Melissa_plugin.xml~ ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version = "1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Melissa_Plugin>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Melissa_Plugin>
8
+ </modules>
9
+ </config>
js/melissadata/Magento.js CHANGED
@@ -3,7 +3,7 @@ Melissa Data Javascript Library for Magento Plugin
3
  Author: Sebastian Enger, M.Sc. //"Liebe besiegt Alles".
4
  Contact: Sebastian.Enger@MelissaData.com
5
  Phone: +49 30 80 933 178-2
6
- Last Modified: 2016-08-17//11:30pm
7
  */
8
 
9
  //$.noConflict();
@@ -58,7 +58,7 @@ z(document).ready(function() {
58
  var is_email_enabled = Cookies.get('MelissaDataMagento_EMAIL_ENABLED');
59
  var is_gaws_enabled = Cookies.get('MelissaDataMagento_GAWS_ENABLED');
60
  var is_gee_enabled = Cookies.get('MelissaDataMagento_GEE_ENABLED');
61
- var gee_singlerow_country = Cookies.get('MelissaDataMagento_GEE_SINGLEROWCOUNTRIES'); // not yet implemented
62
 
63
  var gee_use_single = Cookies.get('MelissaDataMagento_GEE_SINGLEROW_ENABLED');
64
  var gee_use_multi = Cookies.get('MelissaDataMagento_GEE_MULTIROW_ENABLED');
@@ -71,7 +71,7 @@ z(document).ready(function() {
71
  var n_gaws = is_gaws_enabled.includes("1");
72
  var n_email = is_email_enabled.includes("1");
73
 
74
- var resCountry = gee_singlerow_country.split(",");
75
 
76
  //console.log("GEE multi: "+n_gee_multi + " Cookie Gee Mutli: " +gee_use_multi);
77
 
@@ -100,7 +100,7 @@ z(document).ready(function() {
100
 
101
  var insert_string_single_tabs = '<div id="London" class="tabcontent"><br /><p><table id="autocomplete_melissadata_singlerow" border="0px;"><tr style="font-weight: bold; font-size: 140%;"><b id="singleShow">Melissa Data Single Row Autocompletion</b></tr><tr width="" style="clear:both;"><td><br /></td></tr><tr style="clear:both;"><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="1. Type Country" title="Start typing a country name to get Suggestions" id="CountrySuggestionsSingleRow" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showCountryResultsSingleRow" style="height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px"><input type="text" value="" placeholder="2. Type Address" title="Start typing a Postal code & Address to get Suggestions from within that Country" id="AddressSuggestionsSingleRow" style="width: '+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px;" /><span id="showAddressResultsSingleRow" style="width: '+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px; height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="3. Choose Suite" title="Choose an Apartment Number for that Address" id="SubBuildingSingleRow" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showAddressSubPremise" style="width: '+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px; height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td></tr></table></p><br /><br /></div>';
102
 
103
- var insert_string_multi_tabs = '<div id="Paris" class="tabcontent"><br /><p><table id="autocomplete_melissadata_fielded" border="0px;"><tr style="font-weight: bold; font-size: 140%;"><b id="multiShow">Melissa Data Fielded Autocompletion</b></tr><tr width="'+(3*MAX_LENGTH_GEE_FIELDED_BLOCK)+'px"><td><br /></td></tr><tr style="clear:both;"><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="1. Type Country" title="Start typing a country name to get Suggestions" id="CountrySuggestions" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showCountryResults" style="width:150px;height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="2. Type Postal Code" title="Start typing a Postal code to get Suggestions from within that Country" id="PostalCodeSuggestions" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showPostalCodeResults" style="width:150px;height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="3. Type Street Address" title="Start typing a street name to get suggestions for them within that Postal code range in that country" id="StreetSuggestions" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showStreetResults" style="height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="4. Choose Suite" title="Choose an Apartment Number for that Address" id="SubBuildingSuggestions" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showSubPremise" style="width: '+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px; height:75px;line-height:3em;overflow:auto;padding:5px;"></tr></table></p><br /><br /><p></div>';
104
 
105
  var show_tabs = "<ul class=\"tab\"><li><a href=\"#\" class=\"tablinks\" onclick=\"openMDElement(event, 'London')\">Single Row Autocompletion</a></li><li><a href=\"#\" class=\"tablinks\" onclick=\"openMDElement(event, 'Paris')\">Fielded Autocompletion</a></li></ul>";
106
 
@@ -178,6 +178,16 @@ z(document).ready(function() {
178
  // set display to SHOW content
179
  z("#checkout-step-billing").css("display", "inline");
180
  z( show_tabs ).insertBefore("#checkout-step-billing");
 
 
 
 
 
 
 
 
 
 
181
 
182
  if ( n_gee_single === true) {
183
  z( insert_string_single_tabs ).insertBefore("#checkout-step-billing");
@@ -561,7 +571,7 @@ z(document).ready(function() {
561
  b = b.filter(function(e){return e});
562
  var b_html = b.join(",");
563
 
564
- console.log("GB Postalcode: #showStreetResults " + postalcode);
565
 
566
  z("#billing\\:street1").val(a_html);
567
  z("#billing\\:street2").val(b_html);
@@ -577,7 +587,7 @@ z(document).ready(function() {
577
 
578
  } else { // all other countries
579
 
580
- console.log("not GB Postalcode: #showStreetResults " + postalcode);
581
  z("#billing\\:city").val(locality);
582
  z("#billing\\:postcode").val(postalcode);
583
  z("#billing\\:street1").val(deliveryaddr);
@@ -995,7 +1005,7 @@ z(document).ready(function() {
995
  premise = o.Premise;
996
  tn = o.Thoroughfare;
997
 
998
- console.log("sub building:" +subbuilding);
999
  if (((typeof addr != "undefined") && (typeof addr.valueOf() == "string")) && (addr.length > 0)) {
1000
  if (parts_addr_count >= 0){
1001
  parts_addr.push('<option selected value="'+addr+'" organization="'+organization+'" building="'+building+'" premise="'+premise+'" thoroughfare="'+tn+'" subbuilding="'+subbuilding+'" loc="'+loc+'" pc_sec="'+pc_sec+'" pc="'+pc+'" aarea="'+aarea+'" simpleaddr="'+simpleaddr+'" deliver="'+deliver+'">'+addr+'</option>');
@@ -1047,8 +1057,8 @@ z(document).ready(function() {
1047
  delay: 250,
1048
  source: function( request, response ){
1049
  z.ajax({
1050
- url: urlGeePC_Real,
1051
- dataType: "jsonp",
1052
  data: {
1053
  maxrecords: MAX_SHOW_RESULTS,
1054
  postalcode: z("#PostalCodeSuggestions").val(),
@@ -1077,7 +1087,7 @@ z(document).ready(function() {
1077
  arr_pc_options.push('</select>');
1078
  var pc_html = arr_pc_options.join("");
1079
 
1080
- //console.log("POSTALCOOOODEEE: " + pc_html);
1081
 
1082
  z("#showPostalCodeResults").html("");
1083
  z("#showPostalCodeResults").val("");
@@ -1095,7 +1105,8 @@ z(document).ready(function() {
1095
 
1096
  for (i in o) {
1097
  //pc = o.PostalCodePrimary; // hier ansetzen:
1098
- pc = o.PostalCode;
 
1099
  lc = o.Locality;
1100
  aarea = o.AdministrativeArea;
1101
  premise = o.Premise;
@@ -1105,9 +1116,12 @@ z(document).ready(function() {
1105
  pc = o.PostalCodePrimary;
1106
  }
1107
 
1108
- console.log("POSTALCOOOODEEE: " +pc+" locality: "+lc +"country: "+cntry);
1109
  if (((typeof pc != "undefined") && (typeof pc.valueOf() == "string")) && (pc.length > 0) && ((typeof lc != "undefined") && (typeof lc.valueOf() == "string")) && (lc.length > 0)) {
1110
- if (parts_pc_count >= 0){
 
 
 
1111
  parts_pc.push('<option selected value="'+lc+'" premise="'+premise+'" pc="'+pc+'" aarea="'+aarea+'">'+pc+", "+lc+'</option>');
1112
  parts_pc_count++;
1113
  } else if ( parts_pc_count >= 1 && parts_pc_count <= MAX_SHOW_RESULTS ){
3
  Author: Sebastian Enger, M.Sc. //"Liebe besiegt Alles".
4
  Contact: Sebastian.Enger@MelissaData.com
5
  Phone: +49 30 80 933 178-2
6
+ Last Modified: 2016-09-05//11:30pm
7
  */
8
 
9
  //$.noConflict();
58
  var is_email_enabled = Cookies.get('MelissaDataMagento_EMAIL_ENABLED');
59
  var is_gaws_enabled = Cookies.get('MelissaDataMagento_GAWS_ENABLED');
60
  var is_gee_enabled = Cookies.get('MelissaDataMagento_GEE_ENABLED');
61
+ // var gee_singlerow_country = Cookies.get('MelissaDataMagento_GEE_SINGLEROWCOUNTRIES'); // not yet implemented
62
 
63
  var gee_use_single = Cookies.get('MelissaDataMagento_GEE_SINGLEROW_ENABLED');
64
  var gee_use_multi = Cookies.get('MelissaDataMagento_GEE_MULTIROW_ENABLED');
71
  var n_gaws = is_gaws_enabled.includes("1");
72
  var n_email = is_email_enabled.includes("1");
73
 
74
+ // var resCountry = gee_singlerow_country.split(",");
75
 
76
  //console.log("GEE multi: "+n_gee_multi + " Cookie Gee Mutli: " +gee_use_multi);
77
 
100
 
101
  var insert_string_single_tabs = '<div id="London" class="tabcontent"><br /><p><table id="autocomplete_melissadata_singlerow" border="0px;"><tr style="font-weight: bold; font-size: 140%;"><b id="singleShow">Melissa Data Single Row Autocompletion</b></tr><tr width="" style="clear:both;"><td><br /></td></tr><tr style="clear:both;"><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="1. Type Country" title="Start typing a country name to get Suggestions" id="CountrySuggestionsSingleRow" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showCountryResultsSingleRow" style="height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px"><input type="text" value="" placeholder="2. Type Address" title="Start typing a Postal code & Address to get Suggestions from within that Country" id="AddressSuggestionsSingleRow" style="width: '+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px;" /><span id="showAddressResultsSingleRow" style="width: '+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px; height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="3. Choose Suite" title="Choose an Apartment Number for that Address" id="SubBuildingSingleRow" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showAddressSubPremise" style="width: '+MAX_LENGTH_GEE_SINGLELINE_BLOCK+'px; height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td></tr></table></p><br /><br /></div>';
102
 
103
+ var insert_string_multi_tabs = '<div id="Paris" class="tabcontent"><br /><p><table id="autocomplete_melissadata_fielded" border="0px;"><tr style="font-weight: bold; font-size: 140%;"><b id="multiShow">Melissa Data Fielded Autocompletion</b></tr><tr width="'+(3*MAX_LENGTH_GEE_FIELDED_BLOCK)+'px"><td><br /></td></tr><tr style="clear:both;"><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="1. Type Country" title="Start typing a country name to get Suggestions" id="CountrySuggestions" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showCountryResults" style="width:150px;height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="2. Type Postal Code" title="Start typing a Postal code to get Suggestions from within that Country" id="PostalCodeSuggestions" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px;" /><span id="showPostalCodeResults" style="width:150px;height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="3. Type Street Address" title="Start typing a street name to get suggestions for them within that Postal code range in that country" id="StreetSuggestions" style="width: '+(MAX_LENGTH_GEE_FIELDED_BLOCK+40)+'px;" /><span id="showStreetResults" style="height:75px;line-height:3em;overflow:auto;padding:5px;"></span></td><td width="'+MAX_LENGTH_GEE_FIELDED_BLOCK+'px"><input type="text" value="" placeholder="4. Choose Suite" title="Choose an Apartment Number for that Address" id="SubBuildingSuggestions" style="width: '+(MAX_LENGTH_GEE_FIELDED_BLOCK-47)+'px;" /><span id="showSubPremise" style="width: '+MAX_LENGTH_GEE_FIELDED_BLOCK+'px; height:75px;line-height:3em;overflow:auto;padding:5px;"></tr></table></p><br /><br /><p></div>';
104
 
105
  var show_tabs = "<ul class=\"tab\"><li><a href=\"#\" class=\"tablinks\" onclick=\"openMDElement(event, 'London')\">Single Row Autocompletion</a></li><li><a href=\"#\" class=\"tablinks\" onclick=\"openMDElement(event, 'Paris')\">Fielded Autocompletion</a></li></ul>";
106
 
178
  // set display to SHOW content
179
  z("#checkout-step-billing").css("display", "inline");
180
  z( show_tabs ).insertBefore("#checkout-step-billing");
181
+
182
+ z("#singleShow").show();
183
+ z("#singleShow").css("display", "inline");
184
+ z("#autocomplete_melissadata_singlerow").show();
185
+ z("#autocomplete_melissadata_singlerow").css("display", "inline");
186
+
187
+ z("#multiShow").show();
188
+ z("#multiShow").css("display", "inline");
189
+ z("#autocomplete_melissadata_fielded").show();
190
+ z("#autocomplete_melissadata_fielded").css("display", "inline");
191
 
192
  if ( n_gee_single === true) {
193
  z( insert_string_single_tabs ).insertBefore("#checkout-step-billing");
571
  b = b.filter(function(e){return e});
572
  var b_html = b.join(",");
573
 
574
+ //console.log("GB Postalcode: #showStreetResults " + postalcode);
575
 
576
  z("#billing\\:street1").val(a_html);
577
  z("#billing\\:street2").val(b_html);
587
 
588
  } else { // all other countries
589
 
590
+ // console.log("not GB Postalcode: #showStreetResults " + postalcode);
591
  z("#billing\\:city").val(locality);
592
  z("#billing\\:postcode").val(postalcode);
593
  z("#billing\\:street1").val(deliveryaddr);
1005
  premise = o.Premise;
1006
  tn = o.Thoroughfare;
1007
 
1008
+ //console.log("sub building:" +subbuilding);
1009
  if (((typeof addr != "undefined") && (typeof addr.valueOf() == "string")) && (addr.length > 0)) {
1010
  if (parts_addr_count >= 0){
1011
  parts_addr.push('<option selected value="'+addr+'" organization="'+organization+'" building="'+building+'" premise="'+premise+'" thoroughfare="'+tn+'" subbuilding="'+subbuilding+'" loc="'+loc+'" pc_sec="'+pc_sec+'" pc="'+pc+'" aarea="'+aarea+'" simpleaddr="'+simpleaddr+'" deliver="'+deliver+'">'+addr+'</option>');
1057
  delay: 250,
1058
  source: function( request, response ){
1059
  z.ajax({
1060
+ url: urlGeePC_Real,
1061
+ dataType: "jsonp",
1062
  data: {
1063
  maxrecords: MAX_SHOW_RESULTS,
1064
  postalcode: z("#PostalCodeSuggestions").val(),
1087
  arr_pc_options.push('</select>');
1088
  var pc_html = arr_pc_options.join("");
1089
 
1090
+ //console.log("POSTALCOOOODEEE: " + string2); die();
1091
 
1092
  z("#showPostalCodeResults").html("");
1093
  z("#showPostalCodeResults").val("");
1105
 
1106
  for (i in o) {
1107
  //pc = o.PostalCodePrimary; // hier ansetzen:
1108
+ //pc = o.PostalCode;
1109
+ pc = o.PostalCodePrimary;
1110
  lc = o.Locality;
1111
  aarea = o.AdministrativeArea;
1112
  premise = o.Premise;
1116
  pc = o.PostalCodePrimary;
1117
  }
1118
 
1119
+ //console.log("PRE POSTALCOOOODEEE: " +pc+" locality: "+lc + "Count: "+parts_pc_count);
1120
  if (((typeof pc != "undefined") && (typeof pc.valueOf() == "string")) && (pc.length > 0) && ((typeof lc != "undefined") && (typeof lc.valueOf() == "string")) && (lc.length > 0)) {
1121
+ //if (((typeof pc != "undefined") && (typeof pc.valueOf() == "int")) && ((typeof lc != "undefined") && (typeof lc.valueOf() == "string")) ) {
1122
+ //if ( (typeof pc != "undefined") && (typeof lc != "undefined") ) {
1123
+ // console.log("INSIDE POSTALCOOOODEEE: " +pc+" locality: "+lc + "Count: "+parts_pc_count);
1124
+ if (parts_pc_count >= 0){
1125
  parts_pc.push('<option selected value="'+lc+'" premise="'+premise+'" pc="'+pc+'" aarea="'+aarea+'">'+pc+", "+lc+'</option>');
1126
  parts_pc_count++;
1127
  } else if ( parts_pc_count >= 1 && parts_pc_count <= MAX_SHOW_RESULTS ){
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Melissa_Plugin</name>
4
- <version>1.2.4</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>
@@ -12,7 +12,7 @@
12
  <authors><author><name>Sebastian Enger</name><user>melissadata</user>
13
  <email>Sebastian.Enger@MelissaData.com</email></author>
14
  </authors>
15
- <date>2016-08-10</date>
16
  <time>11:24:03</time>
17
  <contents><target name="mage"></target></contents>
18
  <compatible/>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Melissa_Plugin</name>
4
+ <version>1.2.5</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>
12
  <authors><author><name>Sebastian Enger</name><user>melissadata</user>
13
  <email>Sebastian.Enger@MelissaData.com</email></author>
14
  </authors>
15
+ <date>2016-09-05</date>
16
  <time>11:24:03</time>
17
  <contents><target name="mage"></target></contents>
18
  <compatible/>