Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rajeshsingh520/36d7228c70a97ea3c89d7e226c53d68a to your computer and use it in GitHub Desktop.

Select an option

Save rajeshsingh520/36d7228c70a97ea3c89d7e226c53d68a to your computer and use it in GitHub Desktop.
show estimate date as a count of working days from today that is simple sum of (preparation days + shipping days)
add_filter('pisol_edd_product_estimate', function($estimate){
$min = (int) ($estimate['min_preparation_days'] ?? 0) + (int) ($estimate['min_shipping_days'] ?? 0);
$max = (int) ($estimate['max_preparation_days'] ?? 0) + (int) ($estimate['max_shipping_days'] ?? 0);
$estimate['min_days'] = $min;
$estimate['max_days'] = $max;
return $estimate;
});
add_filter('pisol_edd_get_order_estimate', function($estimate){
$min = (int) ($estimate['min_preparation_days'] ?? 0) + (int) ($estimate['min_shipping_days'] ?? 0);
$max = (int) ($estimate['max_preparation_days'] ?? 0) + (int) ($estimate['max_shipping_days'] ?? 0);
$estimate['min_days'] = $min;
$estimate['max_days'] = $max;
return $estimate;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment