-
-
Save xadapter/ea9d60702a5ad8a1f60b86758c28143f to your computer and use it in GitHub Desktop.
Snippet to change the estimated delivery time format on the cart or checkout page. WooCommerce FedEx Shipping Plugin: https://www.pluginhive.com/product/woocommerce-fedex-shipping-plugin-with-print-label/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wf_fedex_estimated_delivery', 'wf_update_delivery_time', 15, 2 ); | |
function wf_update_delivery_time($label, $est_delivery){ | |
$date = explode( '-', $est_delivery['fedex_delivery_time'] ); | |
if( sizeof($date) < 2 ){ | |
return $label; | |
} | |
$d = $date[0]; | |
$m = $date[1]; | |
$y = '20'.$date[2]; | |
$delivery_time = date("l, F jS Y", strtotime($y."-".$m."-".$d)); //(Eg: Tuesday, September 13th 2017). | |
return "<br /><small>Est delivery: $delivery_time</small>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment