Product search results for ""

escape(stripslashes($wp_query->query_vars['s'])); //$sql = "SELECT * FROM `".$wpdb->prefix."wpsc_product_list` WHERE (`".$wpdb->prefix."wpsc_product_list`.`name` LIKE '%".$s."%' OR `".$wpdb->prefix."wpsc_product_list`.`description` LIKE '%".$s."%')"; $searchArray = explode(" ", $s); $count = count($searchArray); for ($i=0; $i < $count; $i++) { $queryExtras .= "list.name LIKE '%".$searchArray[$i]."%' OR list.description LIKE '%".$searchArray[$i]."%' OR "; } $queryExtras = substr($queryExtras, 0, -4); $sql="SELECT list.id,list.name,list.price,image.image,list.special,list.special_price FROM ".$wpdb->prefix."wpsc_product_list AS list LEFT JOIN ".$wpdb->prefix."wpsc_product_images AS image ON list.image=image.id WHERE ($queryExtras) AND list.publish=1 AND list.active=1 "; //echo $sql; $product_list = $wpdb->get_results($sql,ARRAY_A); if (!$product_list) { $output = "

There are no products found which contain the search term ".$s."."; } else { $output = "

\n\r"; foreach((array)$product_list as $product) { $output .= "
\n\r"; $output .= ""; if($product['image'] != '') { $output .= "".$product[\n\r"; $output .= "

\n\r"; $output .= stripslashes($product['name']); $output .= "
"; $output .= "\n\r"; if($product['special']==1) { $output .= "".nzshpcrt_currency_display($product['price'], $product['notax'])."
\n\r"; $output .= nzshpcrt_currency_display(($product['price'] - $product['special_price']), $product['notax'],false,$product['id']); } else { $output .= "".nzshpcrt_currency_display($product['price'], $product['notax']); } $output .= "
\n\r"; $output .= "

\n\r"; } $output .= "
\n\r"; } $output .= "
\n\r"; $output .= "
\n\r"; } // else echo $output; ?>

Website search results for ""