Created
November 26, 2025 01:47
-
-
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
This file contains hidden or 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('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