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_time_slot_filter', 'addingAsap',10,2); | |
add_filter('pisol_dtt_time_range_filter', 'addingAsap',10,2); | |
function addingAsap($slot, $date){ | |
$today = current_time('Y/m/d'); | |
if($today === $date && !empty($slot)){ | |
$type = pi_dtt_delivery_type::getType(); | |
if($type === 'delivery'){ | |
$msg = 'Deliver now'; | |
$top = array(array('id'=>$msg, 'text'=>$msg)); |
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()){ | |
wp_dequeue_script( 'jquery-ui-i18n' ); | |
wp_deregister_script( 'jquery-ui-i18n' ); | |
wp_dequeue_style( 'jquery-ui-style' ); | |
wp_deregister_style( 'jquery-ui-style' ); | |
} | |
}, 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
class custom_shipping_method_discount{ | |
static $instance = null; | |
public $discount_percent = 30; // 30% discount | |
public $coupons = ['test', 'test2']; // Add/remove coupons here | |
public static function get_instance(){ | |
if(self::$instance == null){ | |
self::$instance = new self(); |
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_time_range{ | |
public $product_id; | |
public $start_time; | |
public $end_time; | |
public $date; |
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_cart_item_price', function($price, $cart_item, $cart_item_key){ | |
if(class_exists('pisol_bogo_change_option')){ | |
if(pisol_bogo_change_option::showChangeOptionButton($cart_item)){ | |
$price .= '<br>'.pisol_bogo_change_option::addChangeOptionButton($cart_item, false, 'cart'); | |
} | |
if(pisol_bogo_change_option::showChangeFreeProductButton($cart_item)){ | |
$price .= '<br>'.pisol_bogo_change_option::addChangeFreeProductButton($cart_item, false, 'cart'); | |
} |
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_cart_item_class', function ($class, $cart_item){ | |
if($cart_item['data']->is_on_backorder($cart_item['quantity'])){ | |
$class .= ' pi-back-order-item'; | |
} | |
return $class; | |
}, 10, 2 ); |
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_enq_show_variation_for_simple', '__return_true'); | |
add_action( 'wp_enqueue_scripts', function () { | |
if ( ! is_product() ) return; | |
$js = " | |
jQuery(document).ready(function($){ | |
jQuery(document).on(\"pi_add_to_enquiry_data\", function(e, data){ | |
pi_custom(data); | |
}) | |
function pi_custom(data){ | |
jQuery(\".uni-module-radio\").each(function(e){ |
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 ){ | |
$match = 'pisol_extended_flat_shipping'; | |
$our_rate = []; | |
foreach ( $rates as $rate_id => $rate ) { | |
if(strpos($rate_id, 'pisol_extended_flat_shipping') !== false){ | |
$our_rate[$rate_id] = $rate; | |
unset($rates[$rate_id]); |
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 disable_date_time_for_shipping_method{ | |
static $instance = null; | |
public $shipping_method = 'free_shipping:55';//'flat_rate:2160'; | |
static function get_instance(){ | |
if(is_null(self::$instance)){ | |
self::$instance = new self(); | |
} | |
return self::$instance; |
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_20240106{ | |
static $instance = null; | |
static $production_start_time = '10:00'; //time in 24hr format | |
static $production_end_time = '18:00'; //time in 24hr format | |
public $preparation_time; |