Last active
November 21, 2025 01:43
-
-
Save rajeshsingh520/f00a217435b4f471a422dfee08e5d89f to your computer and use it in GitHub Desktop.
configure different preparation time by day of the week
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
| if(!function_exists('custom_preparation_days_for_sat_sun')) { | |
| add_filter('pisol_dtt_setting_filter_pi_order_preparation_days', 'custom_preparation_days_for_sat_sun', PHP_INT_MAX); | |
| add_filter('pisol_dtt_setting_filter_pi_order_preparation_days_pickup', 'custom_preparation_days_for_sat_sun', PHP_INT_MAX); | |
| add_filter('pisol_dtt_setting_filter_pi_order_preparation_days_delivery', 'custom_preparation_days_for_sat_sun', PHP_INT_MAX); | |
| function custom_preparation_days_for_sat_sun($preparation_days) { | |
| $day = (int) wp_date('w'); // 0 => sunday, 1 => monday | |
| if($day == 0) return 2; | |
| if($day == 6) return 3; | |
| return $preparation_days; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment