*

Jesus

  • ***
  • 38 posts
item_contact_name
« 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!

*

MB Themes

Re: item_contact_name
« Reply #1 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');


  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Jesus

  • ***
  • 38 posts
Re: item_contact_name
« Reply #2 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?

*

MB Themes

Re: item_contact_name
« Reply #3 on: October 21, 2019, 12:02:34 PM »
yes
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

siken

  • ****
  • 136 posts
Re: item_contact_name
« Reply #4 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 :-)

*

MB Themes

Re: item_contact_name
« Reply #5 on: October 22, 2019, 11:15:24 AM »
It was just example with 1 table.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Jesus

  • ***
  • 38 posts
Re: item_contact_name
« Reply #6 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?