Osclass Support Forums

Osclass theme support => Beta Osclass Theme => Topic started by: Jesus on October 09, 2019, 04:12:48 PM

Title: item_contact_name
Post by: Jesus on October 09, 2019, 04:12:48 PM
make the search can also search the name of the users, and that the results give the user items
example: to be able to search for "Pedro" and to show the ads that "Pedro" has

I know it's possible

In the osclass forum I had found something about this, but it doesn't exist anymore and I don't know what to do!
Title: Re: item_contact_name
Post by: MB Themes on October 21, 2019, 10:38:30 AM
@Jesus
You are right, it is possible using code similar to this one:

Code: [Select]
function filter_extend() {
    Search::newInstance()->addConditions(sprintf("%st_item_veronika.i_transaction = %d", DB_TABLE_PREFIX, Params::getParam('sTransaction')));
}

osc_add_hook('search_conditions', 'filter_extend');


Title: Re: item_contact_name
Post by: Jesus on October 21, 2019, 11:54:52 AM
@Jesus
You are right, it is possible using code similar to this one:

Code: [Select]
function filter_extend() {
    Search::newInstance()->addConditions(sprintf("%st_item_veronika.i_transaction = %d", DB_TABLE_PREFIX, Params::getParam('sTransaction')));
}

osc_add_hook('search_conditions', 'filter_extend');

where?, in functions.php of theme?
Title: Re: item_contact_name
Post by: MB Themes on October 21, 2019, 12:02:34 PM
yes
Title: Re: item_contact_name
Post by: siken on October 21, 2019, 09:35:24 PM
@Jesus
You are right, it is possible using code similar to this one:

Code: [Select]
function filter_extend() {
    Search::newInstance()->addConditions(sprintf("%st_item_veronika.i_transaction = %d", DB_TABLE_PREFIX, Params::getParam('sTransaction')));
}

osc_add_hook('search_conditions', 'filter_extend');

item_beta no item_veronika :-)
Title: Re: item_contact_name
Post by: MB Themes on October 22, 2019, 11:15:24 AM
It was just example with 1 table.
Title: Re: item_contact_name
Post by: Jesus on November 23, 2019, 01:46:56 PM
It was just example with 1 table.

function filter_extend() {
    Search::newInstance()->addConditions(sprintf("%st_item_beta.i_item_contact_name = %d", DB_TABLE_PREFIX, Params::getParam('sitem_contact_name')));
}

osc_add_hook('search_conditions', 'filter_extend');

It may be so?