title: woocommerce search only parent category products based on body class
body: <p>I am using the code below but am not sure how to add in two separate search forms that search for products ONLY in the parent category. Either <code>product_parent_cat_floral</code> or <code>product_parent_cat_rentals</code></p>
  
  <pre><code>            &lt;?php
                  $classes = get_body_class();
                  if (in_array('product_parent_cat_rentals',$classes)) {
              ?&gt;
  
                  //rentals search form would go here
  
              &lt;?php } else { ?&gt;
  
                  //flowers search form would go here
  
              &lt;?php } ?&gt;
  </code></pre>
  
  <p>Can I edit this search form to somehow make it only search for products within the appropiate parent class?</p>
  
  <pre><code>    &lt;form role="search" method="get" id="searchform" action="http://botanicaevents.com/rentals/"&gt;
          &lt;div&gt;
              &lt;label class="screen-reader-text" for="s"&gt;Search for:&lt;/label&gt;
              &lt;input type="text" value="" name="s" id="s" placeholder="Search for products" /&gt;
              &lt;input type="submit" id="searchsubmit" value="Search" /&gt;
              &lt;input type="hidden" name="post_type" value="product" /&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>