Good morning everyone. I'm working with the latest version of osclass and the Sigma theme. I'm making a small change to the search sidebar to add a filter (in addition to the existing one that only shows ads with photos), to only show ads that have a phone number.
I then added the checkbox and created a simple plugin that uses the search conditions hook. Questo il codice che ho inserito nel plugin:
<?php
/*
Plugin Name: Filter Listings with Phone
Description: Adds a filter to only display ads with a phone number
Author: Me
Version: 1.0
*/
osc_add_hook('search_conditions', 'filter_with_phone_search_conditions');
function filter_with_phone_search_conditions($params) {
if (Params::getParam('bPhone') == 1) {
$params['where'] .= " AND " . DB_TABLE_PREFIX . "t_item.s_contact_phone IS NOT NULL AND " . DB_TABLE_PREFIX . "t_item.s_contact_phone != ''";
}
return $params;
}
?>
Unfortunately this plugin doesn't seem to give the desired effect. Can any of you help me?