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_google_calendar_event_title', function($title, $order_id, $order) { | |
$customer_name = $order->get_billing_first_name(); | |
$title = $customer_name .' - '.$title; | |
return $title; | |
}, 10, 3); |
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(function_exists('is_checkout') && is_checkout()){ | |
wp_enqueue_style( 'select2-pi', WC()->plugin_url() . '/assets/css/select2.css'); | |
} | |
}, PHP_INT_MAX); |
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(){ | |
wp_dequeue_script('pisol-dtt-date-time-location-block'); | |
wp_deregister_script('pisol-dtt-date-time-location-block'); | |
}, PHP_INT_MAX); |
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_edd_load_simple_product_data', function($data){ | |
$min = 100; | |
$max = 200; | |
$extra = 50; | |
if(!is_numeric($data['min_preparation_days'])) { | |
$data['min_preparation_days'] = $min; | |
} |
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('woocommerce_available_payment_gateways', function($gateways){ | |
if(function_exists('WC') && isset(WC()->session) && is_object(WC()->session)){ | |
WC()->session->set( 'stop_reload_do_ajax_again', null ); | |
} | |
return $gateways; | |
}, PHP_INT_MAX); |
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($days) { | |
$current_day = date('w', strtotime(current_time('Y/m/d'))); | |
// 'w' returns: | |
// 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, | |
// 4: Thursday, 5: Friday, 6: Saturday. | |
if ($current_day >= 0 && $current_day <= 3) { // Sunday to Wednesday | |
$days = 2; | |
} elseif ($current_day == 4) { // Thursday | |
$days = 5; |
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_Checkout_Field_20250301 { | |
static $variation_ids = [ 2, 3, 4, 17 ]; | |
/** | |
* Constructor to set up all hooks. | |
*/ | |
public function __construct() { | |
// Enqueue the custom JavaScript for checkout |
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_head', function () { | |
echo "<style> | |
.pi-cod-deposit-container { | |
position: relative; | |
} | |
.pi-cod-deposit-container .pi-cod-deposit { | |
position: relative !important; | |
} | |
</style>"; | |
}); |
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_date_sort', function($dates){ | |
$filteredDates = []; | |
// Base dates: 22nd Feb 2025 (Saturday) and 23rd Feb 2025 (Sunday) | |
$baseSaturday = strtotime('2025-02-22'); | |
$baseSunday = strtotime('2025-02-23'); | |
foreach ($dates as $date) { | |
$timestamp = strtotime($date); | |
$dayOfWeek = date('w', $timestamp); | |
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( 'woocommerce_package_rates', function ( $rates, $package ) { | |
if ( is_cart() ) { | |
return array(); | |
} | |
return $rates; | |
}, 10, 2 ); | |
add_filter( 'woocommerce_shipping_calculator_enable', function ( $show_shipping ) { | |
if ( is_cart() ) { | |
return false; |
NewerOlder