This code DOES NOT
- Take Location into account
- Take shipping location into account
This code takes "Availability" which is an exact number of weekdays AND "average" shipping time together, and adds it to TODAY.
I ship only in the USA, so I add the maximum amount of days transit time can take to the amount of days it takes to ship out. (5)
So if a product takes 3 business days to ship out. I make availability "8". Then the result on the products page is 8 business days from today.
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>
$DeliveryDate = date('mdY', strtotime("+$product_availability Weekdays"));
$mo = substr($EDD, 0, 2);
$da = substr($EDD, 2, 2);
$yr = substr($EDD, 4, 4);
$DDD = $mo . "/" . $da . "/" . $yr;