问题描述:

I'm just wondering if anyone can provide me with some information into how e-commerce websites automatically calculate the postage and shipping costs for items ordered on-line?

Do these websites use plug-ins/web services to dynamically request this information from the postage/shipping provider? Or do developers manually retrieve the postage costs from the associated shipping provider and then develop their own approximate postage/shipping cost calculation algorithm (in agreement with the e-commerce business of course)? Or are there any alternative approaches used?

Any help is much appreciated. Thanks.

EDIT: I have done some basic research on the topic. I've seen some plug-ins for WordPress but each plug-in was limited to specific postage/shipping companies only.

网友答案:

Do these websites use plug-ins/web services to dynamically request this information from the postage/shipping provider?

Yes, this is certainly an option. In my experience, the APIs provided by UPS and FedEx are decent and work for the UK market.

Or do developers manually retrieve the postage costs from the associated shipping provider and then develop their own approximate postage/shipping cost calculation algorithm?

I would not recommend this - a maintenance headache for one reason - and have never seen it done.

Or are there any alternative approaches used?

Sometimes, fixed shipping-costs can be used - for example, when delivery is to a single country or products weights are relatively static. No API call is needed in these scenarios.

网友答案:

Based on my research, I've found that there doesn't seem to be a single standardised way of calculating shipping/postage costs on e-commerce websites. Some companies provide plugins for WordPress, etcetera, to assist in this process, while others companies provide API's.

Primarily, I'm interested in using a UK based shipping/postage provider.

The Royal Mail is the largest postal provider in the UK and it provides an API for a number of tasks; however no official API appears to be available for cost calculation. I did however manage to find an unofficial Royal Mail cost calculation API. It can be found at the following link.

相关阅读:
Top