Hi, i'm new to osclass and need some help.
I created a price min and max dropdown with options.
What i try now is to show all of this option when no category selected,
and hide some of this options when you select a category.
How to do this?
if(isset($sCategory)) {
$category = array("pk_i_id" => $sCategory);
} else {
if(osc_is_home_page() && osc_is_search_page()){
$category = 'null';
} else {$category = array("pk_i_id" => '0');}
}
osc_categories_select('sCategory', $category , __('All property types', 'ctg_housing')) ; ?>
Here my example of my price min option
<div class="search-box-price-min columns-3">
<select id="priceMin" name="sPriceMin" >
<option value="" hidden >Price Min</option>
<option value="1" <?php if(osc_search_price_min() == 1) echo 'selected' ?>>From Any</option>
<option value="5000" <?php if(osc_search_price_min() == 5000) echo 'selected' ?>>₱ 5,000</option>
<option value="10000" <?php if(osc_search_price_min() == 10000) echo 'selected' ?>>₱ 10,000</option>
<option value="15000" <?php if(osc_search_price_min() == 15000) echo 'selected' ?>>₱ 15,000</option>
<option value="20000" <?php if(osc_search_price_min() == 20000) echo 'selected' ?>>₱ 100,000</option>
<option value="25000" <?php if(osc_search_price_min() == 25000) echo 'selected' ?>>₱ 250,000</option>
<option value="30000" <?php if(osc_search_price_min() == 30000) echo 'selected' ?>>₱ 500,000</option>
</select>
</div>
When selected category for rent only this shows
<div class="search-box-price-min columns-3">
<select id="priceMin" name="sPriceMin" >
<option value="" hidden >Price Min</option>
<option value="1" <?php if(osc_search_price_min() == 1) echo 'selected' ?>>From Any</option>
<option value="5000" <?php if(osc_search_price_min() == 5000) echo 'selected' ?>>₱ 5,000</option>
<option value="10000" <?php if(osc_search_price_min() == 10000) echo 'selected' ?>>₱ 10,000</option>
<option value="15000" <?php if(osc_search_price_min() == 15000) echo 'selected' ?>>₱ 15,000</option>
</div>
When selected category for sale only this shows
<div class="search-box-price-min columns-3">
<select id="priceMin" name="sPriceMin" >
<option value="" hidden >Price Min</option>
<option value="1" <?php if(osc_search_price_min() == 1) echo 'selected' ?>>From Any</option>
<option value="20000" <?php if(osc_search_price_min() == 20000) echo 'selected' ?>>₱ 100,000</option>
<option value="25000" <?php if(osc_search_price_min() == 25000) echo 'selected' ?>>₱ 250,000</option>
<option value="30000" <?php if(osc_search_price_min() == 30000) echo 'selected' ?>>₱ 500,000</option>
</select>
</div>
Hope someone can help me, thanks