Created
March 23, 2024 09:26
-
-
Save rajeshsingh520/f18d0b819378aaacc059796ab340d57b to your computer and use it in GitHub Desktop.
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_action('wp_loaded', function(){ | |
$dates = custom_get_dates_20240323(378); | |
error_log(print_r($dates, true)); | |
}); | |
function custom_get_dates_20240323($location_id){ | |
if(isset(WC()->session) && is_object(WC()->session) && class_exists('pi_dtt_js')){ | |
$old_location = WC()->session->get("pickup_location"); | |
WC()->session->set("pickup_location", $location_id); | |
$dates = pi_dtt_js::allowedDates(); | |
WC()->session->set("pickup_location", $old_location); | |
return $dates; | |
} | |
return []; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment