VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: chekpoint on February 28, 2012, 11:55:49 AM

Title: Searchbox customfields improvement
Post by: chekpoint on February 28, 2012, 11:55:49 AM
Hi!

If u have custom fields, and some records is same, it will be show. All the same records.

For solve this problem:

root/components/com_virtuemart/views/category/view.html.php
in  ' public function getSearchCustom() ' at line 219

org src: $this->_db->setQuery('SELECT `custom_value` as virtuemart_custom_id,`custom_value` as custom_title FROM `#__virtuemart_product_customfields` WHERE virtuemart_custom_id='.$selected->virtuemart_custom_id);
changed src : $this->_db->setQuery('SELECT `custom_value` as virtuemart_custom_id,`custom_value` as custom_title FROM `#__virtuemart_product_customfields` WHERE virtuemart_custom_id='.$selected->virtuemart_custom_id.'  GROUP BY  custom_value');

(added  "GROUP BY  custom_value" statement)