Last active
July 13, 2020 08:42
-
-
Save rajeshsingh520/bf98abfc82a997e4122d133352ddd007 to your computer and use it in GitHub Desktop.
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; | |
$disable_for_product = array(636,637); | |
if(isset(WC()->cart)){ | |
foreach( WC()->cart->get_cart() as $cart_item ) { | |
$product_in_cart = $cart_item['product_id']; | |
if(in_array($product_in_cart, $disable_for_product)){ | |
$value = true; | |
} | |
} | |
} | |
return $value; | |
} | |
} | |
new pisol_marp_disable_dtt_plugin_options(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment