query['ar_wp_product'])) return $template; if ($wp_query->query['ar_wp_product'] == 'productList') { $Domain_name = $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI']; $fetch_url = strtok($Domain_name, '?'); $match_parse = rtrim($fetch_url, '/'); $nonce = decryptIt($_REQUEST['nonce']); if ((isset($nonce) != '') && $nonce != $match_parse) { echo "Not secure Connection"; exit; } $fetch_count = ar_wp_CURL_Call(ar_wp_register_on_plugin . 'plugin_status.php'); $fetch_result = json_decode($fetch_count); $fetch_count_result = $fetch_result->count_result; $data = json_decode(file_get_contents('php://input'), true); $order = ($data['order']) ? $data['order'] : ""; $page = ($data['page_num']) ? $data['page_num'] : ""; $category = ($data['category']) ? $data['category'] : ""; $order = sanitize_text_field($order); $page = sanitize_text_field($page); $category = sanitize_text_field($category); if ($order != '' && $page != '' && $category != '') { //$args = array( 'post_type' => 'arproducts', 'orderby' =>'date','order' => 'ASC','posts_per_page'=>$fetch_count_result); $args = array('post_type' => 'armodels', 'paged' => $page, 'order' => $order, 'posts_per_page' => $fetch_count_result, 'post_status' => 'publish', "orderby" => 'title', 'tax_query' => array( array( 'taxonomy' => 'model_category', 'field' => 'id', 'terms' => $category, ), )); $loop = new WP_Query($args); $product = array(); $count = $loop->post_count; if ($count > 0) { while ($loop->have_posts()) : $loop->the_post(); global $post; $get_model_check = get_post_meta($post->ID, 'ar_wp_product_Detail', true); // Get Models Detail if (!empty($get_model_check)) { $category = get_the_terms($post->ID, 'model_category'); $get_categoty = $category[0]; // Get Ptoduct Category $get_categoty->name = html_entity_decode($category[0]->name); /* * ********* Get Product Image ********** */ $get_product_image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); if ($get_product_image[0]) { $product_image = $get_product_image[0]; } else { $product_image = ''; } /* * ********* End ************ */ /* $get_model = get_post_meta($post->ID, 'ar_wp_product_Detail', true); // Get Models Detail if(!empty($get_model)){ $model = $get_model; }else{ $model = []; } */ $post->name = $post->post_title; //$post->description = $post->post_content; $value = get_post_meta( $post->ID, 'app_description', true ); $post->description = $value; $product_list = $post; $product_list->category = $get_categoty; $product_list->product_image = $product_image; // get the product url $product_list->meta_data = $get_model_check; $product_list->productUrl = get_permalink($post->ID); $product_list_cat->description = (isset($post->post_content) && $post->post_content != "" ? html_entity_decode($post->post_content) : "" ); $product_list_cat = $product_list; $product[] = $product_list_cat; } endwhile; $show_getproduct = array("status" => 200, 'msg' => "Successfully Product Found", "product" => $product); } else { $show_getproduct = array("status" => 400, 'msg' => "No Product Availabel", "product" => ''); } } else { $show_getproduct = array("status" => 401, 'msg' => "Please Enter all parameter", "product" => ''); } echo json_encode($show_getproduct); wp_reset_query(); exit; } return $template; } //http://localhost/3d_woocommerce/?ar_woocommerce=productList //order=ASC //page_num=1 //orderby = meta_value_num //meta_key=_price ?>