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 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 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 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 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; | |
}); |
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_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 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 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 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 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'); | |
} |