Osclass code to filter the search results by seller type

freecoded

freecoded

Administrator
Staff member
Freecoin
2,579
Updated and working code.

Use this in your search form:


<select name="sCompany">
<option value="0">User</option>
<option value="1">Company</option>
</select>

Put this in your functions.php:


<?php
function wm_search_user_type($params) {
if(array_key_exists('sCompany', $params)) {
Search::newInstance()->dao->join(sprintf('%st_user u', DB_TABLE_PREFIX), sprintf('u.pk_i_id = %st_item.fk_i_user_id', DB_TABLE_PREFIX, DB_TABLE_PREFIX), 'LEFT');
Search::newInstance()->dao->where(sprintf('u.b_company = %s', osc_esc_html($params['sCompany'])));
}
}
osc_add_hook('search_conditions', 'wm_search_user_type');
 

Richest Freecoded User

Most Freecoin

freecoded
freecoded
2,579 Freecoin
Davy200
Davy200
590 Freecoin
nathan69
nathan69
424 Freecoin
Laureine
Laureine
415 Freecoin
C
codeguru
295 Freecoin
Tekera
Tekera
263 Freecoin
R
ruthailand
221 Freecoin
A
Akubay
170 Freecoin
smitha
smitha
104 Freecoin
G
Gabby
93 Freecoin
Top