'', 'message' => '' ); $template_products = Wiaas_Admin_Template_Selection::show_template_products($selected_template_id); if (!empty($template_products)) { ob_start(); Wiaas_Admin_Template_Selection::render_template_products($template_products['hardware']); Wiaas_Admin_Template_Selection::render_template_products($template_products['service']); Wiaas_Admin_Template_Selection::render_template_products($template_products['installation']); Wiaas_Admin_Template_Selection::render_template_products($template_products['software']); $response['markup'] = ob_get_clean(); } wp_send_json($response); } /** * Handles adding template categories to template via ajax. */ public static function ajax_add_wiaas_template_product() { check_ajax_referer('wc_bundles_add_bundled_product', 'security'); $loop = intval($_POST['id']); $product_id = intval($_POST['product_id']); $title = $_POST['title']; $options = $_POST['options']; $response = array( 'markup' => '', 'message' => '' ); ob_start(); include('views/html-wiaas-template-product.php'); $response['markup'] = ob_get_clean(); wp_send_json($response); } /** * */ public static function ajax_wiaas_template_category_search() { $term = ($_POST['term']); $response = array(); $terms = get_terms(array( 'taxonomy' => 'template_category', 'name__like' => $term )); foreach ($terms as $t) { $response[$t->term_id] = $t->name; } wp_send_json($response); } } Wiaas_Template_Admin_Ajax::init();