postnl/postnl-magento1

customer account address country field issue

jerry-shopcommerce opened this issue · 2 comments

Submitting issues trough Github

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: https://tig.nl/postnl-magento-extensies/

Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running the latest version of the TIG PostNL Magento extension.

What is the purpose of your issue?

  • Bug report (encountered problems with the TIG PostNL Magento extension)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

I encountered an issue where a customer (from belgium) could not change his/her address in the customer/address/edit/ page.

the reason: postcodecheck.js was looking at harcoded shipping:country_id which does not exist on this page.

After examination of the code i noticed that at line 100 of /master/skin/frontend/base/default/js/TIG/PostNL/postcodecheck.js there is a check if the variable countryField is null and on line 102 the code tries to use this variable.

Next on line 106 the code is looking at the hardcoded element identifier.

I currently fixed this as follows:

diff --git a/skin/frontend/base/default/js/TIG/PostNL/postcodecheck.js b/skin/frontend/base/default/js/TIG/PostNL/postcodecheck.js
index 2e2d1d4..4bb6756 100755
--- a/skin/frontend/base/default/js/TIG/PostNL/postcodecheck.js
+++ b/skin/frontend/base/default/js/TIG/PostNL/postcodecheck.js
@@ -97,13 +97,13 @@ PostnlPostcodecheck = new Class.create({
 
         var postcodeCheck = this;
 
-        if($(countryField) === null || $(countryField).hasClassName('country_hidden') == false) {
+        if($(countryField) !== null || $(countryField).hasClassName('country_hidden') == false) {
 
             $(countryField).observe('change', function() {
                 // When using the billing as shipping the country value of shipping is not updated and always stays
                 // on the default country selected in the configuration.
                 countryId = this.getValue();
-                $('shipping:country_id').setValue(countryId);
+                $(countryField).setValue(countryId);
                 $('postnl_address_error_' + addressType).hide();
                 $('postnl_address_missing_' + addressType).hide();
                 $('postnl_address_invalid_' + addressType).hide();

Thanks in advance

TIG supportdesk

On Github we will respond in English even when the question was asked in Dutch.

Hi Jerry,

Thank you for sharing this with us. Just tried to reproduce this but i am able to change the address with no problem. Are there any other steps i need to do? I added a Belgium address and then went to the edit address page to change the address, this is working as i suspected.

What i will do is my colleague developer have a look at this.

Kind regards,

Jasper
TIG

Hi Jerry,

My colleagues found out about this issue as well a few days ago.
They fixed it for the new 1.15.5 release which will be released soon.

Thanks again for letting us know!

Kind regards,

Jasper
TIG