Skip to content

Instantly share code, notes, and snippets.

@rajeshsingh520
Created November 26, 2025 01:47
Show Gist options
  • Select an option

  • Save rajeshsingh520/2ee4dfcc9a035f955f1a53f8561a7d2a to your computer and use it in GitHub Desktop.

Select an option

Save rajeshsingh520/2ee4dfcc9a035f955f1a53f8561a7d2a to your computer and use it in GitHub Desktop.
increase product preparation time based on the order count in the status processing for estimate date plugin
add_filter('pisol_edd_get_product_data', function($data, $object){
$orders = wc_get_orders([
'status' => 'processing',
'limit' => -1,
'return' => 'ids',
]);
$count = count($orders);
$days = floor($count / 15) + 1;
$data['min_preparation_days'] = $days;
$data['max_preparation_days'] = $days;
return $data;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment