Skip to content

Instantly share code, notes, and snippets.

@xadapter
Last active September 3, 2020 11:34
Show Gist options
  • Save xadapter/c836240ba54a1172d3deab0727620542 to your computer and use it in GitHub Desktop.
Save xadapter/c836240ba54a1172d3deab0727620542 to your computer and use it in GitHub Desktop.
Snippet to add one additional day to the estimated delivery date for FedEx shipping services. WooCommerce FedEx Shipping Plugin: https://www.pluginhive.com/product/woocommerce-fedex-shipping-plugin-with-print-label/
add_filter( 'wf_fedex_estimated_delivery', 'wf_add_delivery_time', 15, 20 );
function wf_add_delivery_time( $est_delivery_html, $est_delivery ) {
$days_to_add = 1;
if( isset($est_delivery['fedex_delivery_time']) ){
$new_date = strtotime( "+$days_to_add day", strtotime($est_delivery['fedex_delivery_time']) );
$new_date = date( apply_filters('wf_estimate_delivery_date_format', 'd-m-Y' ), $new_date );
$est_delivery_html = "<br /><small>".__('Est delivery: ', 'wf-shipping-fedex'). $new_date.'</small>';
}
return $est_delivery_html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment