Last active
July 6, 2024 01:08
-
-
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"
This file contains 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_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