window.location="http://www.price-compare.in/page-not-found/"'; } $result = mysql_fetch_array($rs); $category_name = str_replace("_"," ",$result['category_name']); $category_url = trim($result['product_feed_url']); if ($sub_category_id != "") { $sql_parent_cat_name = "SELECT * from `fk_api_category` WHERE category_id = ".$result['parent_id'].""; $rs_parent_cat_name = mysql_query($sql_parent_cat_name); $res_parent_cat_name = mysql_fetch_array($rs_parent_cat_name); $parent_cat_name = $res_parent_cat_name['category_name']; } else { $parent_cat_name = $category_name; } if ($category_url == "") { $category_url = 'https://affiliate-api.flipkart.net/affiliate/1.0/search.json?query='.urlencode($category_name).'&resultCount=10&inStock=true'; } if (trim($_POST['nextURL']) != ""){ $category_url = trim($_POST['nextURL']); } $dotd_url = $category_url; ?>
0){ foreach ($products as $product) { $product['productBaseInfo'] = $product['productBaseInfoV1']; //echo '
'; print_r($product); echo '
'; continue; // DEBUG CODE //Hide out-of-stock items unless requested. $inStock = $product['productBaseInfo']['inStock']; if(!$inStock && $hidden) continue; //Keep count. $count++; //The API returns these values nested inside the array. //Only image, price, url and title are used in this demo $productId = $product['productBaseInfo']['productId']; $title = $product['productBaseInfo']['title']; $productDescription = $product['productBaseInfo']['productDescription']; //We take the 200x200 image, there are other sizes too. $productImage = array_key_exists('200x200', $product['productBaseInfo']['imageUrls'])?$product['productBaseInfo']['imageUrls']['200x200']:''; $sellingPrice = $product['productBaseInfo']['flipkartSellingPrice']['amount']; $productUrl = $product['productBaseInfo']['productUrl']; $productBrand = $product['productBaseInfo']['productBrand']; $color = $product['productBaseInfo']['attributes']['color']; //Setting up the table rows/columns for a 3x3 view. $end = 0; if($count%3==1) echo '
'; else if($count%3==2) echo '
'; else{ echo '
'; $end =1; } echo '
  • '.$productBrand.'
'.$title.'
Rs. '.$sellingPrice.'
'; if($end) echo '
'; } } if($end!=1) echo '
'; ?>