从网站链接到运输跟踪?
当客户查看订单时。我们向他们展示承运商和追踪号码。但基于这些信息,有没有办法生成直接指向该承运商/货件的跟踪页面的链接?
谢谢
When a customer views an order. We show them the carrier and the tracking number. But based on this information is there a way to generate a link directly to the tracking page for that carrier/shipment?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
取决于运营商。
您可以使用 http: //www.fedex.com/Tracking?action=track&language=english&cntry_code=us&initial=x&tracknumbers=trackingnumber
depends on the carrier.
fedex you can track with http://www.fedex.com/Tracking?action=track&language=english&cntry_code=us&initial=x&tracknumbers=trackingnumber
绝对地;我认为你最大的障碍是获得正确的链接显示格式。
以下是我们用于 UPS 的内容;这是C#,但在php中一定有类似的东西:
hypTracking.Text = TrackingNumber;
hypTracking.NavigateUrl = string.Format("http://wwwapps.ups.com/ etracking/tracking.cgi?InquiryNumber1={0}&track=Track&TypeOfInquiryNumber=T", TrackingNumber);
将其包装在 switch 语句中(例如显示 UPS 的一种格式,FedEx 的另一种格式,USPS 的另一种格式),您应该已准备就绪。
Absolutely; I would think your biggest obstacle would be getting the proper format for the link to display.
Here's what we use for UPS; it's C#, but there must be something comparable in php:
hypTracking.Text = TrackingNumber;
hypTracking.NavigateUrl = string.Format("http://wwwapps.ups.com/etracking/tracking.cgi?InquiryNumber1={0}&track=Track&TypeOfInquiryNumber=T", TrackingNumber);
wrap that in a switch statement (say show one format for UPS, another for FedEx, and another for USPS) and you should be all set.