get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->posts} where `id`=%s and `post_type`=%s and `post_status`=%s", $productId, $productType, $postType)); $tableName = $wpdb->prefix."wc_webhooks"; $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM `$tableName`")); $flag=0; foreach($results as $result){ if(($result->name == '99minds Order Updated') || ($result->name == '99minds Customer Updated') || ($result->name == '99minds Customer Created')){ $flag=$flag+1; } } $postType = "shop_webhook"; $webhooks = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->posts} WHERE post_type =%s", $postType)); if($webhooks){ $flag=0; foreach($webhooks as $webhook){ if(($webhook->post_title == '99minds Order Updated') || ($webhook->post_title == '99minds Customer Updated') || ($webhook->post_title == '99minds Customer Created')){ $flag=$flag+1; } } } $checkplugin = "on"; $option = get_option('minds_access'); if((empty($option)) === FALSE && ($product > 0) && ($flag === 3)){ $checkplugin="off"; } $temp_currency = get_woocommerce_currency(); $woo_currency = get_option('woocommerce_currency'); if($woo_currency === $temp_currency){ if($checkplugin === "off"){ ob_start(); $cart_page_url = get_permalink( wc_get_page_id( 'cart' ) ); if(is_array($atts) === FALSE){ $atts = array(); } $function_name = ""; if(empty($atts['onaddtocart']) === FALSE){ $function_name = $atts['onaddtocart']; } $redirct_url = ""; if(empty($atts['redirect_url']) === FALSE){ $redirct_url = $atts['redirect_url']; } $currency = ""; if(empty($atts['currency']) === FALSE){ $currency = $atts['currency']; } $show_currency_picker = ""; if(empty($atts['show_currency_picker']) === FALSE){ $show_currency_picker = $atts['show_currency_picker']; } $single_page = ""; if(empty($atts['single_page']) === FALSE){ $single_page = $atts['single_page']; } $default_page = ""; if(empty($atts['default_page']) === FALSE){ $default_page = $atts['default_page']; } $onInit = ""; if(empty($atts['oninit']) === FALSE){ $onInit = $atts['oninit']; } $onCurrencyChange = ""; if(empty($atts['oncurrencychange']) === FALSE){ $onCurrencyChange = $atts['oncurrencychange']; } $getCartDetails = ""; if(empty($atts['getcartdetails']) === FALSE){ $getCartDetails = $atts['getcartdetails']; } $getCurrentCustomer = ""; if(empty($atts['getcurrentcustomer']) === FALSE){ $getCurrentCustomer = $atts['getcurrentcustomer']; } if(empty($atts['client_id']) === TRUE){ $access_json = get_option('minds_access'); if(!empty($access_json)){ $access_obj = json_decode($access_json); $atts['client_id'] = $access_obj->access_token; } if(empty($atts['client_id']) === TRUE){ ?>

You have not registered with 99minds yet.

payload
esc_html(MINDS_WIDGET_URL))); ?>

Plugin is not activated properly.

Cannot purchase Giftcard