Skip to content

Instantly share code, notes, and snippets.

@rajeshsingh520
Created February 5, 2025 04:01
Show Gist options
  • Save rajeshsingh520/51ff38207ac61924517106a2c656a262 to your computer and use it in GitHub Desktop.
Save rajeshsingh520/51ff38207ac61924517106a2c656a262 to your computer and use it in GitHub Desktop.
add_filter('pisol_dtt_time_slot_filter', 'addingAsap',10,2);
add_filter('pisol_dtt_time_range_filter', 'addingAsap',10,2);
function addingAsap($slot, $date){
$today = current_time('Y/m/d');
if($today === $date && !empty($slot)){
$type = pi_dtt_delivery_type::getType();
if($type === 'delivery'){
$msg = 'Deliver now';
$top = array(array('id'=>$msg, 'text'=>$msg));
$slot = array_merge($top, $slot);
}
}
return $slot;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment