Products Custom Fields Search

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
MoltenCore
New Member
New Member
Posts: 3
Joined: Wed Apr 04, 2012 4:14 pm

Products Custom Fields Search

Post by MoltenCore »

Hi Folks

I know it still have a bug with the search functionnality with custom fields on the PRODUCTS module. We cant make a succefull search with 2 or more custom fields. But I think I have found
where the problem come from.

Take this SQL query for exemple:

SELECT SQL_CALC_FOUND_ROWS C . * , PH.hierarchy_id
FROM cms_module_products C
LEFT JOIN cms_module_products_prodtohier PH ON PH.product_id = C.id
LEFT JOIN cms_module_products_fieldvals FVA ON C.id = FVA.product_id
AND FVA.fielddef_id =5
LEFT JOIN cms_module_products_fieldvals FVB ON C.id = FVB.product_id
AND FVB.fielddef_id =1
WHERE C.status = 'published'
AND (
FVA.value = 'tertiaire'
)
AND (
FVB.value = '1 pers.'
)ORDER
BY C.product_name ASC
LIMIT 0 , 10000

This is a SQL query from my site after a serach on ONLY 2 custom fields. I
notice that the values of FVA and FVB are wrong. they are inverted: FVA.value should be "1 pers." and FVB.value should be "tertiaire" (ou also can imagine that the fielddef_id are inverted instead of value).

This is the reason why the search result are never good with more than one custom fields.

I tried to look inside the PHP code of this module. The mistake seems to be related to class.products_resultset.php and the $fieldid, $fieldval variables. But I am not good enough in PHP object to find where it start to go wrong.

Its not seems to be a big deal for someone who understand the object logic. And it will fix a realy important functionality of you GREAT products module.

thx for any help
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1976
Joined: Mon Jan 29, 2007 4:47 pm

Re: Products Custom Fields Search

Post by Jo Morg »

If possible file a bug report here: http://dev.cmsmadesimple.org/bug/list/408
Give as much detailed information as possible for the developer to be able to reproduce the issue, and try to fix it, if it really is a bug.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
MoltenCore
New Member
New Member
Posts: 3
Joined: Wed Apr 04, 2012 4:14 pm

Re: Products Custom Fields Search

Post by MoltenCore »

Thanks Jo

I already done it
http://dev.cmsmadesimple.org/bug/view/9651

But I request the Help of the community in case of CG have no time to give anymore to this module.
Post Reply

Return to “Modules/Add-Ons”