Shipping Calculator



Below is sample code that you can use to display a shipping calculator in your eBay listings. This calculator will use the shipping rates defined in your Neto database for the related item. If you have multiple rates per item you can define which rate the calculator will use in your listing template when you list an item. By default it will use the lowest cost.

<p>Enter your post code below to calculate shipping costs for this item. Shipping costs will be applied at checkout.</p>    <form class="form-inline" onsubmit="javascript:return false;">    <input 	class="input-medium" style="padding:4px; height:30px;" placeholder="Enter Post Code" type="text" id="ship_zip">    <button type="button" class="btn" onclick="    window.shfn_callback=function (res) { var h; var c=parseFloat(res['cost']); if(isNaN(c)){c=0;}var rcs=['country','zip','city','state','name','moneysign','desc','cost','eta'];res['moneysign'] = ( c <= 0? '': 'AU$'); if( res['na'] ) { h= unescape('N%2FA'); }else if( c <= 0 ) { h= unescape('FREE'); }else { h= unescape('%5Bname%5D - AU%24%5Bcost%5D %3C%2Fspan%3E%3Cspan class%3D%22tag%22 style%3D%22box-sizing%3A border-box%3B color%3A rgb(0%2C 0%2C 136)%3B%22%3E%3Cbr%3E%3C%2Fspan%3E%3Cspan class%3D%22pln%22 style%3D%22box-sizing%3A border-box%3B color%3A rgb(0%2C 0%2C 0)%3B%22%3E    %5Bdesc%5D'); }var p=0; while(p<h.length) {var st = h.indexOf('[', p);if( st < 0 ) { p = h.length; }else {if(st < p) { st+=p; }var ed = h.indexOf(']', st);if( st < 0 ) { p = h.length; }else {var k = h.substr(st+1,ed - (st+1));if(ed < st) { ed+=st; }p = ed;if(typeof(res[k]) != 'undefined') {var v = ''+unescape(res[k]);h = h.substr(0,st) + unescape(res[k]) +  h.substr(ed+1);p += (v.length - k.length);}p++;}}}var cl = document.getElementById('ship_cost');if(cl) { cl.innerHTML=(h); }var ld = document.getElementById('ship_loading');if(ld) { ld.style.display='none'; }};var shfn=function (z,c,q,x,y,p) {if(typeof(c)=='undefined') { c='AU'; }if(typeof(z)=='undefined') { z=''; }if(typeof(x)=='undefined') { x=''; }if(typeof(y)=='undefined') { y=''; }if(typeof(q)=='undefined') { q=1; }if(typeof(p)=='undefined') { p=''; }var okay=true;if( typeof(okay)=='undefined' || okay===true) {var zo = document.getElementById('ship_zip');if(zo) { var tn = zo.tagName; if(tn) {tn=tn.toUpperCase();} else {tn='';} if(tn=='SELECT') {z=zo.options[zo.selectedIndex].value;} else if(tn=='INPUT') {z=zo.value;} }var ld = document.getElementById('ship_loading');if(ld) { ld.style.display=''; }var qs = [];qs.push('ajfn'+'=getshcost');qs.push('ship_zip'+'='+escape(z));qs.push('ship_country'+'='+escape(c));qs.push('ship_city'+'='+escape(x));qs.push('ship_state'+'='+escape(y));qs.push('ship_qty'+'='+escape(q));qs.push('sku'+'='+'');qs.push('ebtmpl_id'+'='+'0');qs.push('callback'+'='+'shfn_callback');var cl = document.getElementById('ship_cost');if(cl) { var nst = document.createElement('scr'+'ipt');nst.type = 'text'+'/'+'j'+'ava'+'scr'+'ipt';nst.src = 'https://www.neto.com.au/do/WS/eBayJS.js?'+qs.join('&');cl.appendChild(nst); }}};shfn();">Calculate</button>
<div id="ship_cost"></div>
<div id="ship_loading" style="display:none;position:relative;margin-left:130px;margin-top:-25px;" ><img  src="https://www.neto.com.au/assets/loading.gif"/></div></form>

Tag descriptions:
[name] = name of shipping method
[cost] = shipping cost
[desc] = description of shipping method


  • Last Modified: 03/01/2017