postcode-nl / PostcodeNl_Api_MagentoPlugin

A Magento plugin 1.9 that implements the Postcode.nl API for Dutch addresses
BSD 2-Clause "Simplified" License
21 stars 12 forks source link

Not all fields are triggered via events when the extension changes their values #19

Open DaanBroekhof opened 9 years ago

DaanBroekhof commented 9 years ago

@paales wrote: https://github.com/postcode-nl/PostcodeNl_Api_MagentoPlugin/issues/14#issuecomment-65399242

  • There seems to be a bug that it doesn't properly save the address suffix... It seems that the CheckItOut module watches the input's for a change:
       var fields = this.content.select('input', 'select', 'textarea');
       for (var i = 0, l = fields.length; i < l; i ++) {
           if (fields[i].hasClassName('no-autosubmit')) {
               continue;
           }

           fields[i].observe('change', this.onChange);
       }

It it maybe possible to trigger this event when you change the input fields. This properly triggers the >CheckItOut module and will thus fix the second bug.

DaanBroekhof commented 9 years ago

The issue that not all fields are 'triggered' via a javascript event when changed by our extension is something known to us, and we have a fix for that in the pipeline. We need to test it some more to prevent some unwanted side-effects (circular change event loops).

Another issue that might be happening in addition here is that the CheckItOut module creates their observe hooks on page load, when the postcode.nl extension input field have not been added to the checkout form yet.