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_shortcode('pisol_generate_iframe', function ($atts) { | |
$main_domain = 'https://checkout.billsby.com/subscription?data-billsby-company=alldata'; | |
$params = $_GET; | |
$iframe_url = add_query_arg($params, $main_domain); | |
return '<iframe src="' . esc_url($iframe_url) . '" width="100%" height="600px" frameborder="0"></iframe>'; | |
}); |
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 custom_code_block_time_on_date{ | |
static $instance = null; | |
static $block_on_date = '2024/07/31'; | |
static $block_start_time = '10:00'; | |
static $block_end_time = '12:00'; |
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_type', function( $type ){ | |
if ( ! did_action( 'wp_loaded' ) ) return $type; | |
if(function_exists('WC') && isset(WC()->cart) && is_object(WC()->cart) ){ | |
$products = WC()->cart->get_cart(); | |
foreach($products as $product){ | |
if(isset($product['wcsatt_data'])){ | |
return '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('pi_dtt_date_generator', function($dates){ | |
// Get the current date and day of the week using WordPress's current_time() function | |
$today = new DateTime(current_time('Y-m-d')); | |
$dayOfWeek = $today->format('w'); // Get the day of the week (0 = Sunday, 6 = Saturday) | |
$dates = []; // Initialize the dates array | |
if ($dayOfWeek == 6) { | |
// If today is Saturday, no dates should be shown | |
return $dates; |
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_enqueue_scripts', function(){ | |
$js = ' | |
jQuery(function($){ | |
jQuery(document).on("change", ".pisol-location-radio, select[name=\'pickup_location\']", function () { | |
setTimeout(function(){ | |
localStorage.removeItem("pisol_pickup_location"); | |
}, 1); | |
}); | |
}); | |
'; |
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_cefw_cart_total', function($total, $cart, $fee_arg, $fees){ | |
foreach($fee_arg as $fee_detail){ | |
$total += $fee_detail['amount']; | |
} | |
return $total; | |
}, 10, 4); |
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_enqueue_scripts', function () { | |
if(is_cart()) return; | |
wp_dequeue_script('pisol-mmq-amount'); | |
wp_deregister_script('pisol-mmq-amount'); | |
}, 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
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){ |
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_type', function( $val ){ | |
$disable_pickup_for_category = [19]; | |
if ( ! did_action( 'wp_loaded' ) ) return 'Both'; | |
if(function_exists('WC') && isset(WC()->cart) && is_object(WC()->cart)){ | |
foreach( WC()->cart->get_cart() as $cart_item ) { | |
$product_in_cart = $cart_item['product_id']; |
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_enqueue_scripts', function () { | |
$inline_script = " | |
jQuery(document).ready(function($) { | |
jQuery(document).on('pisol_enquiry_cart_count', function(e, count){ | |
jQuery('.dashicons-cart').html('<span>'+count+'</span>'); | |
}); | |
}); | |
"; | |
$custom_css = ' |
NewerOlder