2
아래 코드를 사용하고 있지만 부모 카테고리에서만 제품을 검색하는 두 가지 별도 검색 양식을 추가하는 방법을 모르겠습니다. 어느 product_parent_cat_floral
또는woocommerce 검색 본문 카테고리에만 적용되는 상위 카테고리 제품
<?php
$classes = get_body_class();
if (in_array('product_parent_cat_rentals',$classes)) {
?>
//rentals search form would go here
<?php } else { ?>
//flowers search form would go here
<?php } ?>
product_parent_cat_rentals
은 어떻게 든 그것은 단지 appropiate 부모 클래스 내에서 제품을 검색하기 위해이 검색 양식을 편집 할 수 있습니까?
<form role="search" method="get" id="searchform" action="http://botanicaevents.com/rentals/">
<div>
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="" name="s" id="s" placeholder="Search for products" />
<input type="submit" id="searchsubmit" value="Search" />
<input type="hidden" name="post_type" value="product" />
</div>
</form>