Advertisement
tejshaw

woocommerce product search submit

Sep 17th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2. function submit(){
  3. $args = array(
  4. //'showposts'=> 3,
  5. 'post_type' => 'product',
  6. //'post_status' => 'publish,pending',
  7. 'meta_query' => array(
  8.     'relation' => 'AND',
  9.     array(
  10.         'key' => 'country',
  11.         'value' => $_GET['destination'],
  12.         'type' => 'CHAR'
  13.     ),
  14.     array(
  15.         'key' => 'days',
  16.         'value' => $_GET['days'],
  17.         'type' => 'NUMERIC'
  18.     ),
  19.     array(
  20.         'key' => 'budget',
  21.         'value' => $_GET['budget'],
  22.         'type' => 'NUMERIC'
  23.     )
  24. ),
  25.  
  26. );
  27. //var_dump($args);
  28. $query = new WP_Query();
  29. $query->query( $args );
  30. //The loop
  31. while ($query->have_posts() ) : $query->the_post();
  32.     //get_template_part( 'content', get_post_format() );
  33.     echo '<h1><a href="' . the_permalink() . '">' . the_title(); '</a></h1>';
  34. endwhile;
  35. //var_dump($query);
  36. }
  37.  
  38. //var_dump($args);
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement