PostcodeNl_Api - Version 1.0.8.0

Version Notes

Fixes:
- Prevent error when changing admin roles
Changes:
- Added provisional support for Fire Checkout 1.5
- Added provisional support for EcommerceTeam Easy Checkout 2.0
- Validation texts are hidden when the country is not the Netherlands

Download this release

Release Info

Developer Magento Core Team
Extension PostcodeNl_Api
Version 1.0.8.0
Comparing to
See all releases


Code changes from version 1.0.7.0 to 1.0.8.0

app/code/community/PostcodeNl/Api/etc/adminhtml.xml CHANGED
@@ -11,8 +11,8 @@
11
  <children>
12
  <config>
13
  <children>
14
- <!-- Note: Config name is 'postcode' instead of 'postcode_api' -->
15
- <postcodenl translate="title" module="PostcodeNl_Api">
16
  <title>Postcode.nl API</title>
17
  </postcodenl>
18
  </children>
11
  <children>
12
  <config>
13
  <children>
14
+ <!-- Note: Config name is 'postcodenl' instead of 'postcodenl_api' -->
15
+ <postcodenl translate="title" module="postcodenl_api">
16
  <title>Postcode.nl API</title>
17
  </postcodenl>
18
  </children>
app/code/community/PostcodeNl/Api/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <PostcodeNl_Api>
5
- <version>1.0.7.0</version>
6
  </PostcodeNl_Api>
7
  </modules>
8
  <frontend>
2
  <config>
3
  <modules>
4
  <PostcodeNl_Api>
5
+ <version>1.0.8.0</version>
6
  </PostcodeNl_Api>
7
  </modules>
8
  <frontend>
app/design/frontend/base/default/layout/postcodenl/api/lookup.xml CHANGED
@@ -75,7 +75,17 @@
75
  <block type="postcodenl_api/jsinit" name="postcodenl.jsinit" template="postcodenl/api/jsinit.phtml" />
76
  </reference>
77
  </gomage_checkout_onepage_index>
78
- <!-- For `Fire Checkout` -->
 
 
 
 
 
 
 
 
 
 
79
  <firecheckout_onepage_index>
80
  <reference name="head">
81
  <action method="addCss" ifconfig="postcodenl/config/enabled"><script>postcodenl/api/css/lookup.css</script></action>
75
  <block type="postcodenl_api/jsinit" name="postcodenl.jsinit" template="postcodenl/api/jsinit.phtml" />
76
  </reference>
77
  </gomage_checkout_onepage_index>
78
+ <!-- For `Fire Checkout` 1.5 -->
79
+ <firecheckout_index_index>
80
+ <reference name="head">
81
+ <action method="addCss" ifconfig="postcodenl/config/enabled"><script>postcodenl/api/css/lookup.css</script></action>
82
+ <action method="addJs" ifconfig="postcodenl/config/enabled"><script>postcodenl/api/lookup.js</script></action>
83
+ </reference>
84
+ <reference name="content">
85
+ <block type="postcodenl_api/jsinit" name="postcodenl.jsinit" template="postcodenl/api/jsinit.phtml" />
86
+ </reference>
87
+ </firecheckout_index_index>
88
+ <!-- For `Fire Checkout` 2.0 -->
89
  <firecheckout_onepage_index>
90
  <reference name="head">
91
  <action method="addCss" ifconfig="postcodenl/config/enabled"><script>postcodenl/api/css/lookup.css</script></action>
js/postcodenl/api/lookup.js CHANGED
@@ -447,6 +447,14 @@ document.observe("dom:loaded", function()
447
  toggleCountryPostcode: function (prefix, postcodeFieldId, countryFieldId, street1, street2, street3, street4)
448
  {
449
  var pcnlapi = this;
 
 
 
 
 
 
 
 
450
  if ($(prefix + countryFieldId).getValue() == 'NL')
451
  {
452
  // The Netherlands is selected - add our own validated inputs.
@@ -474,7 +482,7 @@ document.observe("dom:loaded", function()
474
 
475
  if (!$(prefix +'postcode_input:info'))
476
  {
477
- $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="clearfix"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
478
  }
479
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="clearfix"><div class="field input-postcode"><label for="' + prefix + 'postcode_input">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="field input-postcode pcnl-input-housenumber"><label for="' + prefix + 'postcode_housenumber">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
480
  if (!$(prefix +'postcode_input:checkbox'))
@@ -490,7 +498,7 @@ document.observe("dom:loaded", function()
490
 
491
  if (!$(prefix +'postcode_input:info'))
492
  {
493
- $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
494
  }
495
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="fields"><div class="pcnl-apptha-fields"><div class="field"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em>*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div>'+
496
  '<div class="field input-postcode pcnl-input-housenumber"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em>*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></div></li>'});
@@ -507,7 +515,7 @@ document.observe("dom:loaded", function()
507
 
508
  if (!$(prefix +'postcode_input:info'))
509
  {
510
- $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="wide"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></li>'});
511
  }
512
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="input-box"><div class="input-box input-postcode"><label for="' + prefix + 'postcode_input">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +' <span class="required">*</span></label><br>'+
513
  '<input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div>'+
@@ -526,9 +534,9 @@ document.observe("dom:loaded", function()
526
 
527
  if (!$(prefix +'postcode_input:info'))
528
  {
529
- $(prefix + 'country_id').up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="pcnl-info"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
530
  }
531
- $(prefix + 'country_id').up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="fields"><div class="field input-postcode"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="field input-postcode pcnl-input-housenumber"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
532
  if (!$(prefix +'postcode_input:checkbox'))
533
  {
534
  $(prefix + 'country_id').up('li').insert({before: '<li id="' + prefix + 'postcode_input:checkbox" class="pcnl-manual-checkbox"><div class="field"><div class="input-box"><input type="checkbox" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input_checkbox" value="" class="checkbox " /><label for="' + prefix + 'postcode_input_checkbox">'+ PCNLAPI_CONFIG.translations.manualInputText +'</label></div></div></li>'});
@@ -544,7 +552,7 @@ document.observe("dom:loaded", function()
544
 
545
  if (!$(prefix +'postcode_input:info'))
546
  {
547
- $(prefix + street1).up('div.line').insert({before: '<div id="' + prefix + 'postcode_input:info" class="pcnl-info line"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></div>'});
548
  }
549
  $(prefix + street1).up('div.line').insert({before: '<div id="' + prefix + 'postcode_input:wrapper" class="line"><div class="input-postcode left"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<span class="required">*</span></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="input-postcode pcnl-input-housenumber right"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <span class="required">*</span></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></div>'});
550
  if (!$(prefix +'postcode_input:checkbox'))
@@ -560,7 +568,7 @@ document.observe("dom:loaded", function()
560
 
561
  if (!$(prefix +'postcode_input:info'))
562
  {
563
- $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="pcnl-info d_3"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
564
  }
565
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="d_2"><div class="input-postcode d_1"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="input-postcode pcnl-input-housenumber d_4"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
566
  if (!$(prefix +'postcode_input:checkbox'))
@@ -578,7 +586,7 @@ document.observe("dom:loaded", function()
578
 
579
  if (!$(prefix +'postcode_input:info'))
580
  {
581
- $(prefix + street1).up('div.full').insert({before: '<div id="' + prefix + 'postcode_input:info" class="full"><div><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></div>'});
582
  }
583
  $(prefix + street1).up('div.full').insert({before: '<div id="' + prefix + 'postcode_input:wrapper" class="two_fields"><div class="input-postcode short"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'</label> <sup>*</sup><div class="data_area"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="t1 required-entry" /></div></div>' +
584
  '<div class="input-postcode pcnl-input-housenumber short"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +'</label> <sup>*</sup><div><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="t1 pcnl-input-text-half required-entry" /></div></div></div>'});
@@ -607,7 +615,7 @@ document.observe("dom:loaded", function()
607
 
608
  if (!$(prefix +'postcode_input:info'))
609
  {
610
- $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="wide"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
611
  }
612
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="fields"><div class="field"><label for="' + prefix + 'postcode_input" class="required"><em>*</em>'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'</label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="field"><label for="' + prefix + 'postcode_housenumber" class="required"><em>*</em>'+ PCNLAPI_CONFIG.translations.houseNumberLabel +'</label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
613
  if (!$(prefix +'postcode_input:checkbox'))
@@ -623,7 +631,7 @@ document.observe("dom:loaded", function()
623
  }
624
  else
625
  {
626
- this.showFields([prefix +'postcode_input', prefix +'postcode_housenumber', prefix +'postcode_housenumber_addition'])
627
  }
628
 
629
  this.toggleAddressFields(prefix, postcodeFieldId, countryFieldId, street1, street2, street3, street4);
@@ -690,7 +698,13 @@ document.observe("dom:loaded", function()
690
  ], false);
691
 
692
  this.setFieldsReadonly([prefix +'postcode_input', prefix +'postcode_housenumber', prefix +'postcode_housenumber_addition'], true);
693
- this.hideFields([prefix +'postcode_input', prefix +'postcode_housenumber', prefix +'postcode_housenumber_addition']);
 
 
 
 
 
 
694
 
695
  this.showFields([prefix + countryFieldId]);
696
 
@@ -852,6 +866,21 @@ document.observe("dom:loaded", function()
852
  if (!$('shipping:country_id') || $('shipping:country_id').getValue() == 'NL')
853
  this.toggleCountryPostcode('shipping:', 'postcode', 'country_id', 'street1', 'street2', 'street3', 'street4');
854
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
855
  }
856
  // GoMage LightCheckout
857
  if ($('billing_postcode'))
@@ -870,18 +899,19 @@ document.observe("dom:loaded", function()
870
  }
871
  }
872
 
873
- // Misc. account address edits
874
- if ($('zip') && $('street_1'))
875
  {
876
- $('zip').observe('change', function(e)
 
877
  {
878
- pcnlapi.lookupPostcode('', 'zip', 'country', 'street_1', 'street_2', 'street_3', 'street_4', e);
879
  });
880
 
881
- $('country').observe('change', function () { pcnlapi.toggleCountryPostcode('', 'zip', 'country', 'street_1', 'street_2', 'street_3', 'street_4'); });
882
 
883
  if ($('country').getValue() == 'NL')
884
- this.toggleCountryPostcode('', 'zip', 'country', 'street_1', 'street_2', 'street_3', 'street_4');
885
  }
886
 
887
  // Default admin address edits
447
  toggleCountryPostcode: function (prefix, postcodeFieldId, countryFieldId, street1, street2, street3, street4)
448
  {
449
  var pcnlapi = this;
450
+
451
+ // If we have no country set, change to NL (or forms may get confusing when 'reset')
452
+ if ($(prefix + countryFieldId).getValue() == '')
453
+ {
454
+ $(prefix + countryFieldId).setValue('NL');
455
+ pcnlFireEvent($(prefix + countryFieldId), 'change');
456
+ }
457
+
458
  if ($(prefix + countryFieldId).getValue() == 'NL')
459
  {
460
  // The Netherlands is selected - add our own validated inputs.
482
 
483
  if (!$(prefix +'postcode_input:info'))
484
  {
485
+ $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="clearfix"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
486
  }
487
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="clearfix"><div class="field input-postcode"><label for="' + prefix + 'postcode_input">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="field input-postcode pcnl-input-housenumber"><label for="' + prefix + 'postcode_housenumber">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
488
  if (!$(prefix +'postcode_input:checkbox'))
498
 
499
  if (!$(prefix +'postcode_input:info'))
500
  {
501
+ $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
502
  }
503
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="fields"><div class="pcnl-apptha-fields"><div class="field"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em>*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div>'+
504
  '<div class="field input-postcode pcnl-input-housenumber"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em>*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></div></li>'});
515
 
516
  if (!$(prefix +'postcode_input:info'))
517
  {
518
+ $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="wide"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></li>'});
519
  }
520
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="input-box"><div class="input-box input-postcode"><label for="' + prefix + 'postcode_input">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +' <span class="required">*</span></label><br>'+
521
  '<input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div>'+
534
 
535
  if (!$(prefix +'postcode_input:info'))
536
  {
537
+ $(prefix + 'country_id').up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="pcnl-info"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
538
  }
539
+ $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="fields"><div class="field input-postcode"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="field input-postcode pcnl-input-housenumber"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
540
  if (!$(prefix +'postcode_input:checkbox'))
541
  {
542
  $(prefix + 'country_id').up('li').insert({before: '<li id="' + prefix + 'postcode_input:checkbox" class="pcnl-manual-checkbox"><div class="field"><div class="input-box"><input type="checkbox" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input_checkbox" value="" class="checkbox " /><label for="' + prefix + 'postcode_input_checkbox">'+ PCNLAPI_CONFIG.translations.manualInputText +'</label></div></div></li>'});
552
 
553
  if (!$(prefix +'postcode_input:info'))
554
  {
555
+ $(prefix + street1).up('div.line').insert({before: '<div id="' + prefix + 'postcode_input:info" class="pcnl-info line"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></div>'});
556
  }
557
  $(prefix + street1).up('div.line').insert({before: '<div id="' + prefix + 'postcode_input:wrapper" class="line"><div class="input-postcode left"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<span class="required">*</span></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="input-postcode pcnl-input-housenumber right"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <span class="required">*</span></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></div>'});
558
  if (!$(prefix +'postcode_input:checkbox'))
568
 
569
  if (!$(prefix +'postcode_input:info'))
570
  {
571
+ $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="pcnl-info d_3"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
572
  }
573
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="d_2"><div class="input-postcode d_1"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'<em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="input-postcode pcnl-input-housenumber d_4"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +' <em class="required">*</em></label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
574
  if (!$(prefix +'postcode_input:checkbox'))
586
 
587
  if (!$(prefix +'postcode_input:info'))
588
  {
589
+ $(prefix + street1).up('div.full').insert({before: '<div id="' + prefix + 'postcode_input:info" class="full"><div><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></div>'});
590
  }
591
  $(prefix + street1).up('div.full').insert({before: '<div id="' + prefix + 'postcode_input:wrapper" class="two_fields"><div class="input-postcode short"><label for="' + prefix + 'postcode_input" class="required">'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'</label> <sup>*</sup><div class="data_area"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="t1 required-entry" /></div></div>' +
592
  '<div class="input-postcode pcnl-input-housenumber short"><label for="' + prefix + 'postcode_housenumber" class="required">'+ PCNLAPI_CONFIG.translations.houseNumberLabel +'</label> <sup>*</sup><div><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="t1 pcnl-input-text-half required-entry" /></div></div></div>'});
615
 
616
  if (!$(prefix +'postcode_input:info'))
617
  {
618
+ $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:info" class="wide"><div class="input-box"><label class="pcnl-info-label">'+ PCNLAPI_CONFIG.translations.infoLabel +'</label><div class="pcnl-info-text" id="' + prefix + 'postcode_input:info-text">'+ PCNLAPI_CONFIG.translations.infoText +'</div></div></li>'});
619
  }
620
  $(prefix + street1).up('li').insert({before: '<li id="' + prefix + 'postcode_input:wrapper" class="fields"><div class="field"><label for="' + prefix + 'postcode_input" class="required"><em>*</em>'+ PCNLAPI_CONFIG.translations.postcodeInputLabel +'</label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.postcodeInputTitle +'" id="' + prefix + 'postcode_input" value="" class="input-text required-entry" /></div></div><div class="field"><label for="' + prefix + 'postcode_housenumber" class="required"><em>*</em>'+ PCNLAPI_CONFIG.translations.houseNumberLabel +'</label><div class="input-box"><input type="text" title="'+ PCNLAPI_CONFIG.translations.houseNumberTitle +'" name="billing[postcode_housenumber]" id="' + prefix + 'postcode_housenumber" value="" class="input-text pcnl-input-text-half required-entry" /></div></div></li>'});
621
  if (!$(prefix +'postcode_input:checkbox'))
631
  }
632
  else
633
  {
634
+ this.showFields([prefix +'postcode_input', prefix +'postcode_housenumber', prefix +'postcode_housenumber_addition', prefix + 'postcode_input:info-text', prefix + 'postcode_input_checkbox']);
635
  }
636
 
637
  this.toggleAddressFields(prefix, postcodeFieldId, countryFieldId, street1, street2, street3, street4);
698
  ], false);
699
 
700
  this.setFieldsReadonly([prefix +'postcode_input', prefix +'postcode_housenumber', prefix +'postcode_housenumber_addition'], true);
701
+ this.hideFields([
702
+ prefix +'postcode_input',
703
+ prefix +'postcode_housenumber',
704
+ prefix +'postcode_housenumber_addition',
705
+ prefix +'postcode_input:info-text',
706
+ prefix +'postcode_input_checkbox'
707
+ ]);
708
 
709
  this.showFields([prefix + countryFieldId]);
710
 
866
  if (!$('shipping:country_id') || $('shipping:country_id').getValue() == 'NL')
867
  this.toggleCountryPostcode('shipping:', 'postcode', 'country_id', 'street1', 'street2', 'street3', 'street4');
868
  }
869
+
870
+ // Address-book dropdown changes in checkout
871
+ // (some checkout extensions reset values in a strange way after selecting)
872
+ if ($('billing-address-select'))
873
+ {
874
+ $('billing-address-select').observe('change', function () {
875
+ pcnlapi.toggleCountryPostcode('billing:', 'postcode', 'country_id', 'street1', 'street2', 'street3', 'street4');
876
+ });
877
+ }
878
+ if ($('shipping-address-select'))
879
+ {
880
+ $('shipping-address-select').observe('change', function () {
881
+ pcnlapi.toggleCountryPostcode('shipping:', 'postcode', 'country_id', 'street1', 'street2', 'street3', 'street4');
882
+ });
883
+ }
884
  }
885
  // GoMage LightCheckout
886
  if ($('billing_postcode'))
899
  }
900
  }
901
 
902
+ // Misc. frontend account address edits
903
+ if ($('street_1') && ($('zip') || $('postcode')))
904
  {
905
+ var postcodefield = $('zip') ? 'zip' : 'postcode';
906
+ $(postcodefield).observe('change', function(e)
907
  {
908
+ pcnlapi.lookupPostcode('', postcodefield, 'country', 'street_1', 'street_2', 'street_3', 'street_4', e);
909
  });
910
 
911
+ $('country').observe('change', function () { pcnlapi.toggleCountryPostcode('', postcodefield, 'country', 'street_1', 'street_2', 'street_3', 'street_4'); });
912
 
913
  if ($('country').getValue() == 'NL')
914
+ this.toggleCountryPostcode('', postcodefield, 'country', 'street_1', 'street_2', 'street_3', 'street_4');
915
  }
916
 
917
  // Default admin address edits
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PostcodeNl_Api</name>
4
- <version>1.0.7.0</version>
5
  <stability>stable</stability>
6
  <license>Simplified BSD License</license>
7
  <channel>community</channel>
@@ -15,15 +15,16 @@
15
  &#x2022; Improve sale conversion&#xD;
16
  &#xD;
17
  The postcode Magento plugin from Postcode.nl is free of charge, based on a Fair-Use policy. The use of the Postcode.nl Magento plugin is subject to our Terms and Conditions.</description>
18
- <notes>Changes:&#xD;
19
- - Improved 'Never hide country selector' option to also work for regular checkouts&#xD;
20
- - Added provisional support for GrafischDirect One Step Checkout&#xD;
21
- - Improved address housenumber addition user input matching&#xD;
22
- - More Magento coding-standards compliant</notes>
 
23
  <authors><author><name>Postcode.nl Technical Support</name><user>auto-converted</user><email>tech@postcode.nl</email></author></authors>
24
- <date>2013-03-21</date>
25
- <time>14:33:42</time>
26
- <contents><target name="magecommunity"><dir name="PostcodeNl"><dir name="Api"><dir name="Block"><file name="Jsinit.php" hash="79bb826a50ce0cf4f87cc2f958bfafa1"/></dir><dir name="Helper"><file name="Data.php" hash="54281c0641b2123bbe885a3800f8c789"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PcnlController.php" hash="a72395c695188f3a1aff9eb7dba4091d"/></dir><file name="JsonController.php" hash="180f25dccbe40710fea4bbe2a4c4ee8a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="207cb9b9ca018f5e3d1b684e6e8615eb"/><file name="config.xml" hash="f7f0cd6c14f0a933a92383c0c78487d8"/><file name="system.xml" hash="42074f28167cce0aadce2cafa183d9cf"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="postcodenl"><dir name="api"><file name="lookup.xml" hash="4d99ee42b7bcfcff9dcfb41dcb51c838"/></dir></dir></dir><dir name="template"><dir name="postcodenl"><dir name="api"><file name="jsinit.phtml" hash="e08a3ce7a48801bf997dbd4f6743b53f"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="postcodenl"><dir name="api"><file name="lookup.xml" hash="6ec9c69d8cab0db75011fce8e478f6ee"/></dir></dir></dir><dir name="template"><dir name="postcodenl"><dir name="api"><file name="jsinit.phtml" hash="339610e5950a53c3966d80cccf9bede4"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="layout"><dir name="postcodenl"><dir name="api"><file name="lookup.xml" hash="f59eb1b9834a5a71c07ce55d7f98fbd8"/></dir></dir></dir><dir name="template"><dir name="postcodenl"><dir name="api"><file name="jsinit.phtml" hash="339610e5950a53c3966d80cccf9bede4"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="PostcodeNl_Api.csv" hash="e906b29f07ffd60defa504be687f8238"/></dir><dir name="nl_NL"><file name="PostcodeNl_Api.csv" hash="a87ec754c45a12ea048792503b5d6dcd"/></dir></target><target name="mageweb"><dir name="js"><dir name="postcodenl"><dir name="api"><file name="lookup.js" hash="ae79418caa3b13b52567a8308becf94b"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="postcodenl"><dir name="api"><dir name="css"><file name="lookup.css" hash="c58103b505f8bcdf55cea1159ca21e27"/></dir><dir name="images"><file name="postcode-logo.png" hash="da02bc29be1057a0201e63f81ee4bd02"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="postcodenl"><dir name="api"><dir name="css"><file name="lookup.css" hash="def30283baa30441588be03adb47feb6"/></dir><dir name="images"><file name="postcode-logo.png" hash="da02bc29be1057a0201e63f81ee4bd02"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="postcodenl"><dir name="api"><dir name="css"><file name="lookup.css" hash="54afa1de84fddeece289b20d817f7e13"/></dir><dir name="images"><file name="postcode-logo.png" hash="da02bc29be1057a0201e63f81ee4bd02"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PostcodeNl_Api.xml" hash="feeaf95128ffe4ad109ed8b0b8bc85ab"/></dir></target></contents>
27
  <compatible/>
28
  <dependencies/>
29
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PostcodeNl_Api</name>
4
+ <version>1.0.8.0</version>
5
  <stability>stable</stability>
6
  <license>Simplified BSD License</license>
7
  <channel>community</channel>
15
  &#x2022; Improve sale conversion&#xD;
16
  &#xD;
17
  The postcode Magento plugin from Postcode.nl is free of charge, based on a Fair-Use policy. The use of the Postcode.nl Magento plugin is subject to our Terms and Conditions.</description>
18
+ <notes>Fixes:&#xD;
19
+ - Prevent error when changing admin roles &#xD;
20
+ Changes:&#xD;
21
+ - Added provisional support for Fire Checkout 1.5&#xD;
22
+ - Added provisional support for EcommerceTeam Easy Checkout 2.0&#xD;
23
+ - Validation texts are hidden when the country is not the Netherlands</notes>
24
  <authors><author><name>Postcode.nl Technical Support</name><user>auto-converted</user><email>tech@postcode.nl</email></author></authors>
25
+ <date>2013-05-14</date>
26
+ <time>09:22:26</time>
27
+ <contents><target name="magecommunity"><dir name="PostcodeNl"><dir name="Api"><dir name="Block"><file name="Jsinit.php" hash="79bb826a50ce0cf4f87cc2f958bfafa1"/></dir><dir name="Helper"><file name="Data.php" hash="54281c0641b2123bbe885a3800f8c789"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PcnlController.php" hash="a72395c695188f3a1aff9eb7dba4091d"/></dir><file name="JsonController.php" hash="180f25dccbe40710fea4bbe2a4c4ee8a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="81edeaeb27dbdcfabebf1fd29ec4aa8f"/><file name="config.xml" hash="bf62e13f3ea834fb609e897c1c4f6150"/><file name="system.xml" hash="42074f28167cce0aadce2cafa183d9cf"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="postcodenl"><dir name="api"><file name="lookup.xml" hash="4d99ee42b7bcfcff9dcfb41dcb51c838"/></dir></dir></dir><dir name="template"><dir name="postcodenl"><dir name="api"><file name="jsinit.phtml" hash="e08a3ce7a48801bf997dbd4f6743b53f"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="postcodenl"><dir name="api"><file name="lookup.xml" hash="6ec9c69d8cab0db75011fce8e478f6ee"/></dir></dir></dir><dir name="template"><dir name="postcodenl"><dir name="api"><file name="jsinit.phtml" hash="339610e5950a53c3966d80cccf9bede4"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="layout"><dir name="postcodenl"><dir name="api"><file name="lookup.xml" hash="a6ed08cf4bff3e6e07aec0cbe38df9a1"/></dir></dir></dir><dir name="template"><dir name="postcodenl"><dir name="api"><file name="jsinit.phtml" hash="339610e5950a53c3966d80cccf9bede4"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="PostcodeNl_Api.csv" hash="e906b29f07ffd60defa504be687f8238"/></dir><dir name="nl_NL"><file name="PostcodeNl_Api.csv" hash="a87ec754c45a12ea048792503b5d6dcd"/></dir></target><target name="mageweb"><dir name="js"><dir name="postcodenl"><dir name="api"><file name="lookup.js" hash="3d06ff6481395cc6e1595ef64203297d"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="postcodenl"><dir name="api"><dir name="css"><file name="lookup.css" hash="c58103b505f8bcdf55cea1159ca21e27"/></dir><dir name="images"><file name="postcode-logo.png" hash="da02bc29be1057a0201e63f81ee4bd02"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="postcodenl"><dir name="api"><dir name="css"><file name="lookup.css" hash="def30283baa30441588be03adb47feb6"/></dir><dir name="images"><file name="postcode-logo.png" hash="da02bc29be1057a0201e63f81ee4bd02"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="postcodenl"><dir name="api"><dir name="css"><file name="lookup.css" hash="54afa1de84fddeece289b20d817f7e13"/></dir><dir name="images"><file name="postcode-logo.png" hash="da02bc29be1057a0201e63f81ee4bd02"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PostcodeNl_Api.xml" hash="feeaf95128ffe4ad109ed8b0b8bc85ab"/></dir></target></contents>
28
  <compatible/>
29
  <dependencies/>
30
  </package>