Function to Retrieve FedEx Ground Shipping Rates |
[eluser]danoph[/eluser]
Here is code to retrieve fedex ground shipping rates instantly from using the API on their website. The function as shown has the origin state and zip hardcoded in the function and will take destination state and zip as function arguments. You need two of their API files for this to work, fedex.php and xmlparser.php. You can download those from http://bizwidgets.biz/downloads/fedex_api_files.zip. This example shows the two files being hosted in the libraries folder in a normal CodeIgniter project. Important! If you need to expand upon this function and get rates for Express Shipping (like next day, two day, etc instead of ground shipping), you need to change the carrier code to FDXE instead of FDXG. Code: function ship_rate($dest_state = "", $dest_zip = "") {
[eluser]helphelp[/eluser]
Thanks, although i am looking for UPS shipping. But your code still help a lot. I am wondering what does "$rate = $price->price->rate;" do? I think you can just echo $price for the rate? Thanks |
Welcome Guest, Not a member yet? Register Sign In |