grahamgr3 Posted July 14, 2015 Share Posted July 14, 2015 In the ecommerce2 example is how shipping is covered handled. I am wondering how we code our php scripts to know how to calculate shipping for multiple products per order, by weight, size, etc. How do we do that, in the glossary I don't see a section that covers shipping. Link to comment Share on other sites More sharing options...
Larry Posted July 15, 2015 Share Posted July 15, 2015 I thought I discussed this a bit in the book. It really depends upon many things--types of products, business model, etc. As a general rule of thumb, if the types of products vary greatly, I'd recommend using a third-party service that calculates shipping costs for you. You'd post a request to their API with the salient details and then get shipping costs in return. This would then dictate what kind of information you'd need to store along with the products: specifically size and weight. But the short version is you either take the easy route, charging a flat amount (which has its downsides), or you'll want to use a third-party service that can accurately calculate shipping costs for you. Link to comment Share on other sites More sharing options...
Recommended Posts