Last active
November 17, 2020 01:25
-
-
Save rajeshsingh520/30e6d185a867d6ecf7d3d838ccb689d3 to your computer and use it in GitHub Desktop.
Show time slot of pikcup now or deliver now or asap
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_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'; | |
| }else{ | |
| $msg = 'Pickup 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