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(107, 109); // 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
<?php | |
add_action( 'wp_loaded', 'pisol_enable_plugin_for_category' ); | |
function pisol_enable_plugin_for_category(){ | |
$enable_for_cat = 107; // this will be your category id for which you want to enable the plugin | |
$plugin_disabled = true; | |
if(isset(WC()->cart)){ | |
foreach( WC()->cart->get_cart() as $cart_item ) { |
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_action('wp_enqueue_scripts','pisol_placeholder_replacement'); | |
function pisol_placeholder_replacement(){ | |
$js = 'jQuery(function($){ | |
window.pi_date_options.datePlaceholder = "Date....."; | |
});'; | |
wp_add_inline_script('jquery',$js,'after'); | |
} |
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('pisol_dtt_setting_filter_pi_type', 'allowDeliveryWhenProduct'); | |
function allowDeliveryWhenProduct($type){ | |
$delivery_only_for_this_product = 636; | |
$type = 'Pickup'; | |
if(isset(WC()->cart)){ | |
foreach( WC()->cart->get_cart() as $cart_item ) { |
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('pisol_dtt_setting_filter_pi_type', 'forcePickupforProduct'); | |
function forcePickupforProduct($type){ | |
$only_pickup_for_this_products = array(636, 637); // put the id's of the product for which you only want pickup | |
if(isset(WC()->cart)){ | |
foreach( WC()->cart->get_cart() as $cart_item ) { | |
if(in_array($cart_item['product_id'],$only_pickup_for_this_products)){ |
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('pisol_dtt_time_slot_filter','pickupNow',10, 2); | |
add_filter('pisol_dtt_time_range_filter','pickupNow',10, 2); | |
function pickupNow($time, $date){ | |
$type = pi_dtt_delivery_type::getType(); | |
$current_date = current_time('Y/m/d'); | |
if($type == 'pickup' && $current_date == $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
<?php | |
add_filter('pisol_dppp_enable_popup', function($value){ | |
if(is_page(334)){ // this will disable the preference popup on page 334 | |
return false; | |
} | |
return $value; | |
}); |
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 | |
class pisol_marp_disable_dtt_plugin_options{ | |
function __construct(){ | |
add_filter('pisol_disable_dtt_completely', array($this, 'disableDateTimePlugin')); | |
} | |
function disableDateTimePlugin($value){ | |
if(is_admin()) return; | |
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 | |
class pisol_quanity_limit_for_product{ | |
private $product_id = 637; // this is the product for which your want to limit the slot | |
private $limit = 10; // this is the slot limit of product quantity | |
function __construct(){ | |
add_filter('pisol_dtt_time_slot_filter', array($this,'timeFilter'),100, 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
<?php | |
add_filter('pisol_fsnw_final_ajax_filter', 'disableFreeShippingBarForClassOfProduct'); | |
function disableFreeShippingBarForClassOfProduct($json){ | |
$shipping_classes = array(128); // shipping class id for which the free shipping bar will be hidden | |
$if_exists = false; | |
foreach( WC()->cart->cart_contents as $key => $values ){ | |
if( in_array( $values[ 'data' ]->get_shipping_class_id(), $shipping_classes ) ){ | |
$if_exists = true; |