Created
May 13, 2026 12:25
-
-
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)
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_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