4

Does anyone know of a freeware shipping calculator for PHP? I do not want anything too fancy, and it can be compatible with any of the major US domestic shipping services.

If anyone knows of one that is a plugin for CodeIgniter that would be nice.

Travis

4

5 回答 5

9

Usually services like this are based on web services offered from the various couriers. You would send the weight and dimensions of the box you want to ship to their web service, and they would return a corresponding shipping price. Each couriers API would be different. I'm not sure if there are any libraries that aggregate all these services together, but I've never seen one. Since prices can change at any time, you pretty much have to use some kind of web service to access this information. That is, unless you are Amazon sized and have preexisting arrangements for pricing rates on shipping with the various couriers. Just from a quick lookup, here is some of the services that FedEx offers.

于 2008-11-26T02:20:07.663 回答
2

If you sign up for a free account at eship.purolator.com and they have sample code that can be implemented into any website for anything you could think of.

https://eship.purolator.com/SITE/resourcecentre/samplecode.aspx

-James

于 2009-08-07T01:32:28.400 回答
1

如果您想节省一些时间,我编写了一个支持 UPS、美国邮件和联邦快递的 PHP 运费计算器。可在此处获得:http: //www.soniccode.com/php_shipping_rates_calculator.php

于 2009-04-05T23:11:31.930 回答
1

UPS 的简单计算器,不需要 UPS 帐户即可获得费率: http ://www.geekpedia.com/tutorial213_Creating-a-UPS-Shipping-Calculator.html

于 2009-09-16T17:30:54.307 回答
0

有一项服务允许您访问他们的 API,该 API 与 Fedex、USPS、UPS 和 DHL 的 API 集成。允许提出请求的费用为每月 25 美元,但它是一个完整的解决方案。OP 声明“免费软件”,但我认为即使您必须付费,其他人也会遇到此问题并欣赏解决方案。

http://www.auctioninc.com/info/page/shipping_api

他们有一个 php sdk,所以它在 php 上更容易。根据他们的解释,他们不确定您是否可以使用 AJAX,因此我们只是将其构建为通过 AJAX 发布到 php.ini。效果很好!

老帖子,我知道。但是新的选项变得可用,旧的线程仍然会出现在搜索结果中。

于 2011-09-02T19:55:21.513 回答