관리-도구
편집 파일: geolocation.min.js
jQuery(function(n){var o=window.location.toString(),a=function(){kkart_geolocation_params.hash&&n('a[href^="'+kkart_geolocation_params.home_url+'"]:not(a[href*="v="]), a[href^="/"]:not(a[href*="v="])').each(function(){var a=n(this),o=a.attr("href"),t=o.split("#");o=0<(o=t[0]).indexOf("?")?o+"&v="+kkart_geolocation_params.hash:o+"?v="+kkart_geolocation_params.hash,"undefined"!=typeof t[1]&&null!==t[1]&&(o=o+"#"+t[1]),a.attr("href",o)})},t={url:kkart_geolocation_params.kkart_ajax_url.toString().replace("%%endpoint%%","get_customer_location"),type:"GET",success:function(a){a.success&&a.data.hash&&a.data.hash!==kkart_geolocation_params.hash&&(a=a.data.hash,o=0<o.indexOf("?v=")||0<o.indexOf("&v=")?o.replace(/v=[^&]+/,"v="+a):0<o.indexOf("?")?o+"&v="+a:o+"?v="+a,window.location=o)}};"1"===kkart_geolocation_params.is_available&&(n.ajax(t),n("form").each(function(){var a=n(this),o=a.attr("method"),t=0<a.find('input[name="v"]').length;o&&"get"===o.toLowerCase()&&!t?a.append('<input type="hidden" name="v" value="'+kkart_geolocation_params.hash+'" />'):(t=a.attr("action"))&&(0<t.indexOf("?")?a.attr("action",t+"&v="+kkart_geolocation_params.hash):a.attr("action",t+"?v="+kkart_geolocation_params.hash))}),a()),n(document.body).on("added_to_cart",function(){a()}),n(document.body).on("kkart_append_geo_hashes",function(){a()})});