This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; |
This file contains hidden or 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 Pi_dpmw_selection_rule_custom_partial_payment{ | |
public $slug; | |
public $condition; | |
function __construct($slug){ | |
$this->slug = $slug; | |
$this->condition = 'custom_partial_payment'; | |
/* this adds the condition in set of rules dropdown */ | |
add_filter("pi_".$this->slug."_condition", array($this, 'addRule')); | |
This file contains hidden or 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_pldt_settings_filter', function($setting){ | |
$selected_shipping_method = WC()->session->get('chosen_shipping_methods'); | |
if(is_array($selected_shipping_method) && in_array('flat_rate:2160', $selected_shipping_method)){ | |
$setting['disable_date_time_field'] = 1; | |
} | |
return $setting; | |
}, PHP_INT_MAX); | |
add_filter('pisol_dtt_setting_filter_pi_datetime', function($date_time){ |
This file contains hidden or 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_pccdt_product_restricted_by_pickup_location', function($return, $product_id, $cart_item){ | |
if (isset($cart_item['wcpaIgnore'])) $return = false; | |
return $return; | |
}, 10, 3); |
This file contains hidden or 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_pccdt_preparation_minutes', function($minutes){ | |
if($minutes > 60){ | |
$minutes = 60; | |
} | |
return $minutes; | |
}); |