0 && $stock_status == 'instock' ) { NotifyUser( $offer_id ); } /*echo "
";
	print_r( $offer_meta );
	echo "
";*/ //die(); } add_action('wp_ajax_send_notification', 'send_notification_func'); add_action('wp_ajax_nopriv_send_notification', 'send_notification_func'); function send_notification_func() { $product_id = $_POST['product_id']; $offer_id = $_POST['offer_id']; $email = $_POST['email']; $exists = CheckAEmailExists( $offer_id, $email ); //if( $exists ) { return false; } if( $product_id && $offer_id && trim($email) != '' ) { AddToWaitList( $product_id, $offer_id, $email ); } wp_die(); } add_action('init', 'stock_noti_actions'); function stock_noti_actions() { if( $_GET['confirm_noti'] && $_GET['confirm_noti'] != '' ) { ConfirmNoti( $_GET['confirm_noti'] ); } if( $_GET['cancel_noti'] && $_GET['cancel_noti'] != '' ) { CancelNoti( $_GET['cancel_noti'] ); } } // SQL table /* CREATE TABLE `notifier_table` ( `id` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY, `product_id` int(100) NOT NULL, `offer_id` int(100) NOT NULL, `email` varchar(100) NOT NULL ); */ ?>