Skip to content

Instantly share code, notes, and snippets.

@rajeshsingh520
Last active November 21, 2025 01:43
Show Gist options
  • Select an option

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

Select an option

Save rajeshsingh520/f00a217435b4f471a422dfee08e5d89f to your computer and use it in GitHub Desktop.
configure different preparation time by day of the week
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