Advertisement:

Author Topic: Custom field search  (Read 5452 times)

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #60 on: June 22, 2018, 09:29:39 pm »
Thank you very much Marius  ;) now its working.
i don't wanna close the topic and work on making this through function.php
because this is a core edit and its better to be in function.php
thank you again marius

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Custom field search
« Reply #61 on: June 22, 2018, 09:35:34 pm »
You won't do it via hooks. It's not possible.

Edit, anyway, by searching into custom fields the speed of the search is reduced.
« Last Edit: June 22, 2018, 10:47:36 pm by marius-ciclistu »

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #62 on: June 22, 2018, 11:06:48 pm »
You won't do it via hooks. It's not possible.

Edit, anyway, by searching into custom fields the speed of the search is reduced.


with your code also speed of search reduces?

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Custom field search
« Reply #63 on: June 22, 2018, 11:20:15 pm »
With my first solution the speed is not reduced, but with this core mod it is.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #64 on: June 23, 2018, 05:06:11 am »
With my first solution the speed is not reduced, but with this core mod it is.

which one is your first solution?

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Custom field search
« Reply #65 on: June 23, 2018, 09:23:24 am »
From the begining of this topic. Putting custom fields values into the description before save and removing them before displaying the description in view.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #66 on: June 30, 2018, 10:40:18 am »
From the begining of this topic. Putting custom fields values into the description before save and removing them before displaying the description in view.

I'm working to find a way to do this in function.php
I will update here as soon as i find a solution

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #67 on: March 08, 2019, 11:55:27 am »
please help me to do this,
i explained in the first post of this topic

thanks to @marius-ciclistu that solved this by editing core files here:
https://forums.osclass.org/development/please-help-to-do-this/msg163268/#msg163268

but i'm trying to do this by hook in functions.php, please help me to do this thanks,

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Custom field search
« Reply #68 on: March 08, 2019, 06:51:10 pm »
You can search on google marius ciclistu ft_min_word_len and see the search core mods to see how I edited there the description before save and before displaying it with addunderline and removeunderline functions.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #69 on: March 09, 2019, 03:16:03 am »
You can search on google marius ciclistu ft_min_word_len and see the search core mods to see how I edited there the description before save and before displaying it with addunderline and removeunderline functions.

Hey Marius, but im trying to do it in functions.php!
Did you updated that code since then? Or its the same code? If you updated please give me to update the code too thanksss

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Custom field search
« Reply #70 on: March 09, 2019, 10:49:32 pm »
I did not update it but there are hooks for editing the item before saving it. Teseo gave me the hook solution for that.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #71 on: March 10, 2019, 08:08:07 am »
I did not update it but there are hooks for editing the item before saving it. Teseo gave me the hook solution for that.

Would you please share with us those hooks?

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Custom field search
« Reply #72 on: March 10, 2019, 09:36:50 am »
osc_add_filter('item_add_prepare_data', 'cust_filter_title_description');
 osc_add_filter('item_edit_prepare_data', 'cust_filter_title_description');
 ?>

https://stackoverflow.com/questions/43015613/how-to-modify-ft-min-word-len-4-to-ft-min-word-len-1-so-that-osclass-3-7-1-can-s

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: Custom field search
« Reply #73 on: March 11, 2019, 02:14:16 am »
osc_add_filter('item_add_prepare_data', 'cust_filter_title_description');
 osc_add_filter('item_edit_prepare_data', 'cust_filter_title_description');
 ?>

https://stackoverflow.com/questions/43015613/how-to-modify-ft-min-word-len-4-to-ft-min-word-len-1-so-that-osclass-3-7-1-can-s

Is this code related to custom-field search you have solved in this post
:?
https://forums.osclass.org/development/please-help-to-do-this/msg163268/#msg163268

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Custom field search
« Reply #74 on: March 11, 2019, 07:00:08 am »
You said you wanted to add the custom fields into the description. This is the way to do it. Make 2 functions to add and remove them from description. This is a model.