Try this
in index.php of osclass pay add:
function osp_search_exclude_unpaid_filter($where = '', $item_table_alias = null) {
if(osp_param('publish_allow') != 1) {
return $where;
}
$item_table_alias = ($item_table_alias === null ? DB_TABLE_PREFIX.'t_item' : $item_table_alias);
$paid = osp_param('publish_item_disable') == 1 ? 0 : 1;
$cond = sprintf("EXISTS (SELECT 1 FROM %st_osp_item as ospx WHERE ospx.i_item_id = %s.pk_i_id AND ospx.s_type = '101' AND coalesce(ospx.i_paid, 0) = %d)", DB_TABLE_PREFIX, $item_table_alias, $paid);
$where = trim((string)$where);
return ($where == '' ? $cond : $where .' AND ' . $cond);
}
osc_add_filter('custom_item_search_conditions', 'osp_search_exclude_unpaid_filter');
in delta functions.php , before this block:
if($withPicture) {
$prem_where = ' AND ' . $whe;
add:
$whe = osc_apply_filter('custom_item_search_conditions', $whe);