<?php echo 'Category'; ?> - Chefpro India "get_product_by_category_id", "category_id" => $decrypted_id ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $result1 = json_decode($curl_response, true); $categoryArray = $_POST['product_category']; $productTypesArray = $_POST['product_types']; $brandArray = $_POST['brand']; $numbers = array_column($result1, 'ProductOfferPrice'); $initminPrice = min($numbers); $initmaxPrice = max($numbers); //If product category is empty if(empty($_POST['product_category'])) { $service_url = $server_url; $curl = curl_init($service_url); $curl_post_data = array( "function" => "get_product_by_category_id", "category_id" => $decrypted_id ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $result1 = json_decode($curl_response, true); } // print_r($result1); //Get submitted category, producttypes, brand in an array $categoryArray = $_POST['product_category']; $productTypesArray = $_POST['product_types']; $brandArray = $_POST['brand']; $numbers = array_column($result1, 'ProductOfferPrice'); $initminPrice = min($numbers); $initmaxPrice = max($numbers); //Check if category array is empty or not if (!empty($categoryArray)) { for ($i = 0; $i < count($categoryArray); $i++) { $service_url = $server_url; $curl = curl_init($service_url); $curl_post_data = array( "function" => "get_product_by_category_id", "category_id" => $categoryArray[$i] ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $result2 = json_decode($curl_response, true); $result1 = array_merge((array) $result1, (array) $result2/* , $arrayN, $arrayN */); } $numbers = array_column($result1, 'ProductOfferPrice'); $initminPrice = min($numbers); $initmaxPrice = max($numbers); } // Check if Product array is empty or not. $index=0; if (!empty($productTypesArray)) { foreach ($result1 as $key =>$value){ if(in_array($value['ProductType'], $productTypesArray)) { $result_pt[$index++] = $result1[$key]; } } $result1 = array_values($result_pt); } //Check if brand array is empty or not. $index=0; if (!empty($brandArray)) { foreach ($result1 as $key =>$value){ if(in_array($value['ProductManufacturer'], $brandArray)) { $result_brand[$index++] = $result1[$key]; } } $result1 = array_values($result_brand); } // check if min prise select for price range if (isset($_POST['hdnmin'])) { $j=0; $result3=[]; for ($i = 0; $i < count($result1); $i++) { if ($result1[$i]['ProductOfferPrice'] >= $_POST['hdnmin'] && $result1[$i]['ProductOfferPrice'] <= $_POST['hdnmax']) { $result3[$j++]=$result1[$i]; } } $result1=[]; $result1=$result3; } ?> "get_category_by_id", "Category_id" => $decrypted_par_id ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $result_category = json_decode($curl_response, true); // Get all product types $service_url = $server_url; $curl = curl_init($service_url); $curl_post_data = array( "function" => "get_product_types" ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $result_product_types = json_decode($curl_response, true); //Get all brand $service_url = $server_url; $curl = curl_init($service_url); $curl_post_data = array( "function" => "get_brand" ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $result_brand = json_decode($curl_response, true); ?> $b['ProductOfferPrice'] ? -1 : 1; }); } function getAddress() { $protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'; return $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } $category = []; $relatedArray = []; $category[0] = $decrypted_id; if(!empty($categoryArray)){ $category = array_merge((array)$category, $categoryArray); } $j=0; for($i=0;$i "get_related_category", "category_id" => $category[$i] ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $response = json_decode($curl_response, true); for($x=0;$x "get_product_by_category_id", "category_id" =>$relatedArray[$i]['FK_RelatedCatId'] ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $related_category_product_result = array_merge((array)$related_category_product_result, json_decode($curl_response, true)); } // print_r($result1); ?>

'; ?>

'; if(file_exists('img/cached/product/'.$result1[$i]['ImageFilePath'])){ echo ''; }else{ echo ''; } echo ' ' . round($result1[$i]['offer_percent'], 2) . '%'; if($result1[$i]['ProductInStock']>0){ echo'
'; } echo'
'; if($result1[$i]['ProductInStock']>0){ echo'

' . $result1[$i]['ProductName'] . '

' . $result1[$i]['ProductOfferPrice'] . ' ' . $result1[$i]['ProductPrice'] . '
'; }else{ echo'

' . $result1[$i]['ProductName'] . '

' . $result1[$i]['ProductOfferPrice'] . ' ' . $result1[$i]['ProductPrice'] . '
OUT OF STOCK
'; } echo'
'; } } // } // else{ // // echo '

There are no products in this category!!!

'; // } ?>
'; echo''; echo''; echo''; if(file_exists('img/cached/product/'.$result1[$i]['ImageFilePath'])){ echo''; }else{ echo''; } echo''; if($result1[$i]['ProductInStock']>0){ echo''; }else{ echo''; } //echo'
'; } ?>

Filter By

Price

" style="border: 0; color:#7a7a7a;" />

"get_realted_products_by_cat_id", "category_id" => $result_category[$i]['CategoryId'] ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); $product_result[$i] = json_decode($curl_response, true); $result_counter++; } // print_r($product_result); ?>