mardi 3 juin 2014

Woocommerce Product Search with Taxonomy


Vote count:

0




Hi have a search form that is allows the user to input a keyword then select a taxonomy via dropdown list. This is my form:



<form name="myCity" id="myCity" action="http://mywebsite.com/" method="post">

<div class="search-area">

<div class="container">

<div class="row-fluid">
<div class="span4">
<label><i class="icon-search"></i></label>
<div class="search-area-division search-area-division-input">
<input type="text" value="<?php echo get_search_query(); ?>" name="s" id="s" placeholder="I am searching for..."/>

</div>
</div>
<div class="span3">
<label><i class="icon-map-marker"></i></label>

<?php
$args = array('taxonomy' => 'pa_city');
wp_dropdown_categories( $args );
?>

</div>
</div>
<noscript><input type="hidden" onclick="WriteCookie()" class="btn btn-block btn-white search-btn" value="<?php echo esc_attr__( 'Search' ); ?>"/></noscript>
<input type="hidden" name="post_type" value="product" />

</div>
</div>


If I search mini-golf in Bullhead City,


it returns the URL: http://ift.tt/1x2ZO3p


While it returns products with the tag mini-golf, it returns all products regardless of city that match mini-golf. I have tried many ways to filter the results and am just spinning my wheels at this point.


The taxonomy I am using is pa_city. Even if the url is http://ift.tt/1ougVp4


it does the same thing.


I am sure it is a simple thing but I have no clue.


Any advice greatly appreciated



asked 21 secs ago






Aucun commentaire:

Enregistrer un commentaire