PluginProbe
PostNL for WooCommerce / 4.0.0
PostNL for WooCommerce v4.0.0
5.9.12 5.9.11 5.9.10 5.9.9 5.9.8 5.9.7 5.9.6 trunk 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.1.4 3.1.5 3.1.6 3.1.7 4.0.0 4.0.1 4.0.2 4.3.2 4.3.3 4.4.0 4.4.1 All 72 releases
woo-postnl / assets / js / account-page.js

account-page.js in PostNL for WooCommerce 4.0.0, at assets/js/account-page.js

33 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready(function($) {
2
3 function localize_address_fields(address_type) {
4 /* Hide custom NL fields by default when country not NL */
5 var country = $('#' + address_type + '_country').val();
6 if (typeof country != 'undefined') {
7 if (country != 'NL') {
8 $('#' + address_type + '_street_name_field').hide();
9 $('#' + address_type + '_house_number_field').hide();
10 $('#' + address_type + '_box_number_field').hide();
11 $('#' + address_type + '_address_1_field').show();
12 $('#' + address_type + '_address_2_field').show();
13 } else {
14 $('#' + address_type + '_street_name_field').show();
15 $('#' + address_type + '_house_number_field').show();
16 $('#' + address_type + '_box_number_field').show();
17 $('#' + address_type + '_address_1_field').hide();
18 $('#' + address_type + '_address_2_field').hide();
19 }
20 }
21 }
22
23 localize_address_fields('billing');
24 localize_address_fields('shipping');
25
26 $('#billing_country, #shipping_country').change(function() {
27 id = $(this).attr('id');
28 address_type = id.replace('_country', '');
29 localize_address_fields(address_type);
30 });
31
32 });
33