} // Remove product from the wishlist if ($_GET['action'] == 'remove_from_wishlist') { $count = yith_wcwl_count_products(); if ($yith_wcwl->remove($_GET['wishlist_item_id'])) { _e('Product successfully removed.', 'yit'); } else { echo '#' . $count . '#'; _e('Error. Unable to remove the product from the wishlist.', 'yit'); } if (!$count) { _e('No products were added to the wishlist', 'yit'); } wp_redirect($yith_wcwl->get_wishlist_url()); die; } elseif ($_GET['action'] == 'add_to_wishlist') { $return = $yith_wcwl->add(); if ($return == 'true') { echo $return . '##' . __('Product added!', 'yit'); } elseif ($return == 'exists') { echo $return . '##' . __('Product already in the wishlist.', 'yit'); } elseif (count($yith_wcwl->errors) > 0) { echo $yith_wcwl->get_errors(); } wp_redirect(get_permalink(intval($_GET['add_to_wishlist']))); die; } elseif ($_GET['action'] == 'prod_find') { if ($yith_wcwl->is_product_in_wishlist($_POST['prod_id'])) { echo "exists"; } }