Advertisement
tejshaw

woocommerce product search

Sep 17th, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1.  
  2. <?php
  3. require_once('submit.php');
  4. if(isset($_GET['destination'], $_GET['days'], $_GET['budget'])){
  5.     echo submit();
  6.     return;
  7. }
  8. ?>
  9. <form role="search" method="get" id="searchform" action="">
  10. <?php
  11. $terms = get_terms("pa_country");
  12. $count = count($terms);
  13. if($count > 0){
  14. echo '<select class="select" id="destination" tabindex="11"  name="destination">';
  15. echo '<option value="Destination">--Destination--</option>';
  16. foreach($terms as $term ){
  17.         echo '<option value="' . $term->name . '">' . $term->name . '</option>';
  18.     }
  19.     echo '</select>';
  20. }
  21.  
  22. $terms = get_terms("pa_days");
  23. $count = count($terms);
  24. if($count > 0){
  25.     echo '<select class="select" id="days" tabindex="11" name="days">';
  26.     echo '<option value="Days">--Days--</option>';
  27.     foreach($terms as $term ){
  28.         echo '<option value="' . $term->name . '">' . $term->name . '</option>';
  29.     }
  30.     echo '</select>';
  31. }
  32.  
  33. $terms = get_terms("pa_budget");
  34. $count = count($terms);
  35. if($count > 0){
  36.     echo '<select class="select" id="budget" tabindex="11" name="budget">';
  37.     echo '<option value="Budget">--Budget--</option>';
  38.     foreach($terms as $term ){
  39.         echo '<option value="' . $term->name . '">' . $term->name . '</option>';
  40.     }
  41.     echo '</select>';
  42. }
  43. ?>
  44. <input type="submit" id="searchsubmit" value="<?php echo esc_attr__( 'Search' ); ?>" />  
  45. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement