postnl / postnl-magento1-End-of-life

This is the official Magento 1 extension of PostNL.
12 stars 9 forks source link

customer account address country field issue #26

Closed jerry-shopcommerce closed 6 years ago

jerry-shopcommerce commented 6 years ago

Submitting issues trough Github

Please follow the guide below


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

Issues with outdated version will be rejected.


What is the purpose of your issue?


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.

tig-jaspersmits commented 6 years ago

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

tig-jaspersmits commented 6 years ago

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