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
<?php | |
/** This will disable order limit by day, time slot this will increase your speed a lot */ | |
add_filter("pisol_disable_order_limit_check", '__return_true'); |
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
<?php | |
/* | |
Make sure auto selection of date and time is disabled | |
https://wordpress.org/plugins/woo-save-abandoned-carts/ | |
*/ | |
add_action('wp_enqueue_scripts', 'pisol_clearValue'); | |
function pisol_clearValue(){ | |
if(is_checkout()){ | |
$js = 'jQuery(function ($) { | |
setTimeout(\'jQuery("#pi_delivery_date").val("")\',100); |
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
<?php | |
/** different preparaton time for delivery/pickup */ | |
/* making preparation days as zero */ | |
add_filter('pisol_dtt_setting_filter_pi_order_preparation_days',function($val){ return 0; }); | |
add_filter('pisol_dtt_setting_filter_pi_order_preparation_hours','pisolDifferentPrep'); | |
function pisolDifferentPrep($value){ | |
$type = pi_dtt_delivery_type::getType(); | |
if($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
<?php | |
add_filter('pisol_dtt_setting_filter_pi_type','deliveryTypeBasedOnCartTotal'); | |
function deliveryTypeBasedOnCartTotal($type){ | |
$min_amount = 50; // change this amount as per your minimum requirement for delvieru | |
if(function_exists('WC') && isset(WC()->cart)){ | |
$total = (float)WC()->cart->subtotal; | |
if($total < $min_amount){ | |
$type = 'Pickup'; | |
}else{ |
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
<?php | |
/* This code remove the time slot as soon as the time slot starts */ | |
add_filter('pisol_dtt_custom_remove_time_slots', 'pisolStopWhenStartSlotReached',100,2); | |
function pisolStopWhenStartSlotReached($slots, $date){ | |
$current_date = current_time('Y/m/d'); | |
$current_time = current_time("H:i"); | |
if($date == $current_date){ | |
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
/** | |
* All of the CSS for your admin-specific functionality should be | |
* included in this file. | |
*/ | |
/*! | |
* Bootstrap Grid Only (grid and responsive utilities extracted from Bootstrap 4.1.3) | |
* GitHub: https://github.com/dmhendricks/bootstrap-grid-css | |
* Bootstrap License: MIT (https://github.com/twbs/bootstrap/blob/v4-dev/LICENSE) | |
* Credits: Twitter, Inc. & The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) | |
*/ |
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
<?php | |
/* | |
Plugin Name: Making 24hr time comparing for order date and time | |
*/ | |
add_filter('pisol_dtt_time_slot_filter','pisol_small_addon_timeTo24Hour',10, 2); | |
add_filter('pisol_dtt_time_range_filter','pisol_small_addon_timeTo24Hour',10, 2); | |
function pisol_small_addon_timeTo24Hour($times, $date){ | |
$current = current_time('Y/m/d H:i'); | |
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
<?php | |
add_filter('pisol_disable_ajax_location',function($val){ return true; }); |
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
<?php | |
add_filter('pisol_dtt_setting_filter_pi_order_preparation_days',function($val){ return 0; }); | |
add_filter('pisol_dtt_setting_filter_pi_order_preparation_hours','pisolDifferentPrep'); | |
function pisolDifferentPrep($value){ | |
$type = pi_dtt_delivery_type::getType(); | |
if($type == "delivery"){ | |
return 180; | |
}else{ | |
return 60; | |
} |
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
class pisol_marp_disable_dtt_plugin_options{ | |
function __construct(){ | |
add_filter('pisol_disable_dtt_completely', array($this, 'disableDateTimePlugin')); | |
} | |
function disableDateTimePlugin($value){ | |
if(is_admin()) return; | |
$disable_for_product = array(660, 665, 685); // product ids for which date and time plugin will be disabled | |
if(isset(WC()->cart)){ |
OlderNewer