1/* JavaScript for Frontend pages */ 2jQuery(document).ready(function($) { 3 try { 4 // Invalidate cache of WooCommerce minicart when billing country changes. 5 // This will ensure that the minicart is updated correctly 6 supports_html5_storage = ('sessionStorage' in window && window['sessionStorage'] !== null); 7 if(supports_html5_storage) { 8 // The fragment name might be generated dynamically by WooCommerce, so 9 // we have to retrieve it from the WC parameters 10 // @since WC 3.1 11 var fragment_name = 'wc_fragments'; 12 if((typeof wc_cart_fragments_params !== 'undefined') && wc_cart_fragments_params && wc_cart_fragments_params.fragment_name) { 13 fragment_name = wc_cart_fragments_params.fragment_name; 14 } 15 16 $('.checkout').on('change', '#billing_country', function() { 17 sessionStorage.removeItem(fragment_name, ''); 18 }); 19 } 20 } 21 catch(exception) { 22 var error_msg = 'Aelia - Exception occurred while accessing window.sessionStorage. ' + 23 'This could be caused by the browser disabling cookies. ' + 24 'COOKIES MUST BE ENABLED for the site to work correctly. ' + 25 'Exception details below.'; 26 console.log(error_msg); 27 console.log(exception); 28 } 29 30 // Hide the "Change country" button and submit the Widget form when billing 31 // country changes 32 $('.widget_wc_aelia_customer_country_selector_widget') 33 .find('.change_country') 34 .hide() 35 .end() 36 .on('change', '.countries', function(event) { 37 var widget_form = $(this).closest('form'); 38 39 $(widget_form).find('.aelia_customer_country').val($(this).val()); 40 $(widget_form).submit(); 41 event.stopPropagation(); 42 return false; 43 }); 44});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.