Skip to content

Instantly share code, notes, and snippets.

@rajeshsingh520
Last active July 6, 2024 01:08
Show Gist options
  • Save rajeshsingh520/fd6248ad0fe0b3bb33b91bc5369d1072 to your computer and use it in GitHub Desktop.
Save rajeshsingh520/fd6248ad0fe0b3bb33b91bc5369d1072 to your computer and use it in GitHub Desktop.
This code set the preparation days to 2 days when it is saturday and user selected the delivery type "Delivery"
add_filter('pisol_dtt_setting_filter_pi_order_preparation_days', function($preparation_days){
$type = pi_dtt_delivery_type::getType();
$today = current_time('Y/m/d');
$todays_day = date('w', strtotime($today));
if(($todays_day == 6 || $todays_day == 5) && $type == 'pickup'){
if(class_exists('pisol_pldt_location')){
$location = pisol_pldt_location::getSavedPickupLocation();
if($location != 5073){
$preparation_days = 2;
}
}
}
return $preparation_days;
},200,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment