Implementing UPS Time in Transit on Cart Page

We are trying to implement the UPS time in transit calculation on our cart page (see screenshot 1).

The Alt-Team Estimate Shipping Cost plugin does essentially what we are looking to do but in a different fashion and on every product page - we simply want to incorporate the Time in Transit calculations into the Estimate Shipping Costs pop up on our cart page (see screenshot 2).

Upon inspection of the shippings/ups.php script, at the bottom it appears as if the functionality we are looking for is there but commented out:

//$days_to_delivery = $shipment[$i]->getValueByPath(“/GuaranteedDaysToDelivery”);

We are looking to display $days_to_delivery. Commenting it out makes the page 404, as this functionality I guess hasn't been completely built in by CS Cart. I have the UPS developer kit on my machine and a fairly strong understanding of PHP, just wondering if anyone has an idea how we can go about this or if anyone has done similar and can provide some tips?



Time in Transit is a completly different API and shipment codes (thank you UPS). So true Time In Transit needs to be a separate shipping function with mapping from the TNT codes to the current UPS shipment codes.

I did an addon of this sort quite a while ago but stopped selling it because of lack of demand.

Thanks for your response tbirnseth - how difficult was it to create the modification to accomplish what we are looking for? Any suggestions on where to start?

Was a lot of work and there was no correlation between codes.

Interesting. I was disappointed to find out that the 'calculate shipping costs' function in the cart and the shipping section of the checkout page do not display real transit time.

This would be very nice to have.

I have just requested a quote for functionality to show location dependent shipping / payment information (including UPS transit times) on the 'payment information' page.

The way I had done this was:[list]

[]Utilize the 'calculate_shipping_rates' (maybe had to add an earlier one, I don't remember) hook to call an API that returns the available shipping methods via TNT API.

]Loop through the result and see if any of them match up (map to) the shipping methods that are available via cs-cart's locations.

[]Replace the 'delivery_time' element of the standard shipping method with what was returned from the TNT query (caching the results)

]return from the hook and let the normal quote process complete.

[]There was also a bunch of calculation due to shipping cut off times that affected the 'date' that was sent to TNT. I.e. if order is placed after 3pm, use next day as the pickup date for getting an accurate delivery date.

]Then you have to account for the cases where “tomorrow” is not a shipping pick up day and adjust the date to the next pickup day.

[*]Also, Saturday delivery is an option and if the TNT falls on Sat for a particular method, you need to get rid of the other methods that do not support Sat delivery…


As I said, developing this with all the various rules took quite a bit of time and in the end, the original customer decided they did not want to pay the cost. I had made it a standard addon back in the V2.0 era but since there was zero demand, I put it in the archive and haven't looked at it since.

This was used for a “gift basket” site where there were perishable items and so having delivery match to a specific date in the future was critical for when to process the order. There was also an option to let the customer specify the date they wanted delivery and work backwards from there adding a “pack” field to the order that could be sorted in the admin along with status.