---- dataentry snippet ---- type : snippet #do not change this line category : shipping #mention the category like 'shipping', 'checkout' etc name : Australia TNT Rate Requests. #the name of the snippet description : #description about snippet versions_tags : #compatible versions reference_url : http://forum.foxycart.com/comments.php?DiscussionID=1983&page=1 #Item_7 # External link tags_tags : snippets, shipping, advance #tags, separated by commas. date_dt : 2011-05-27 #the date in YYYY-MM-DD format ---- ===== Australia TNT Rate Requests ===== function sendTNTRequest(request_data, target) { $.getJSON("http:////?data=" + $.jSONToString(request_data) + "&callback=?", function(quote) { if (quote.error) { showError(ERROR + "\n\nReason: " + quote.error) } else { // this request is either from the cart page if ($(target).attr("id") == "cart-shipping-cost") { $(target).html("$" + quote.cost) } // ...or the checkout page else { // update the shipping cost FC.checkout.config.orderFlatRateShipping = quote.cost // display the new order total FC.checkout.updatePrice(-1) } } }) } ===== Related Forum Discussions ===== * http://forum.foxycart.com/comments.php?DiscussionID=1983&page=1#Item_7