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_cefw_fees_filter', function($fees){ | |
foreach($fees as $key => $fee){ | |
$original_amount = $fee['amount']; | |
$roundedNumber = floor($original_amount * 100) / 100; | |
$fees[$key]['amount'] = $roundedNumber; | |
} | |
return $fees; | |
},10,1); |
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_code_20241213{ | |
static $instance = null; | |
static $section = [ |
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 pisol_marp_disable_dtt_plugin_options_for_category{ | |
function __construct(){ | |
add_filter('pisol_disable_dtt_completely', array($this, 'disableDateTimePlugin')); | |
} | |
function disableDateTimePlugin($value){ | |
if(is_admin()) return; | |
$disabe_for_cat = array(19); // Category id for which the plugin will be disabled | |
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_enqueue_scripts', function(){ | |
if(function_exists('WC') && isset(WC()->session) && is_object(WC()->session)){ | |
WC()->session->set('pickup_location', null); | |
} | |
$js = ' | |
jQuery(function($){ | |
localStorage.removeItem("pisol_pickup_location"); | |
}); | |
'; |
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
<?php | |
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 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_enqueue_scripts', function(){ | |
if(function_exists('is_checkout') && !is_checkout()) return; | |
$js = ' | |
jQuery(document).ready(function($){ | |
function pisol_custom_changePosition(){ | |
var selectedRow = jQuery("td.pi-condition-fees").parent(); | |
selectedRow.prependTo("table.woocommerce-checkout-review-order-table thead"); |
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_code_20241213{ | |
static $instance = null; | |
static $section = [ | |
0 => [ | |
'product_ids' => [201, 749, 564], | |
'dates' => ['2024/12/21', '2024/12/22', '2024/12/23', '2024/12/24', '2024/12/25'], | |
'disable_date_time' => '2024/12/21 12:00' | |
], |
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_enqueue_scripts', function(){ | |
if(!is_product()) return; | |
$js = " | |
document.addEventListener('DOMContentLoaded', function () { | |
function attachChangeListeners() { | |
document.querySelectorAll('.pi-special-qty').forEach(function (element) { | |
// Remove any previously attached listener to avoid duplication | |
element.removeEventListener('change', handleChange); | |
// Attach the change event listener |
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_forced_time_slots', function($slots, $day, $date, $type){ | |
if($type !== 'delivery') return $slots; | |
$cutoff_time = '17:00'; | |
$next_day_allowed = '15:00'; | |
$today = current_time('Y/m/d'); | |
$current_time = current_time('H:i'); | |
$next_date = date('Y/m/d', strtotime($today . ' +1 day')); | |
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_cefw_cart_total', function($total, $cart){ | |
$total = $cart->get_subtotal(); | |
$tax_total = $cart->get_subtotal_tax(); | |
$shipping = $cart->get_shipping_total(); | |
$shipping_tax = $cart->get_shipping_tax(); | |
return $total+$tax_total+$shipping+$shipping_tax; | |
},10,2); |