Home General questions Making the 'quick search' feature search by a...
Making the 'quick search' feature search by a product code
In default CS-Cart quick search searches by product name and description.
To make the 'quick search' feature search by a product code:
- Open the search_products.php file located in the include/common directory of your CS-Cart installation.
- Find and replace the following part of code there:
foreach ($pieces as $piece) { $tmp = array(); if ($search_data['search_product_name'] == 'Y') { $tmp[] = "descr1.product LIKE '%$piece%'"; } if ($search_data['search_short_description'] == 'Y') { $tmp[] = "descr1.short_description LIKE '%$piece%'"; }
with this one:
foreach ($pieces as $piece) { $tmp = array(); if ($search_data['search_product_name'] == 'Y') { $tmp[] = "descr1.product LIKE '%$piece%'"; } if ($search_data['search_product_name'] == 'Y') { $tmp[] = "products.product_code LIKE '%$piece%'"; } if ($search_data['search_short_description'] == 'Y') { $tmp[] = "descr1.short_description LIKE '%$piece%'"; } - Save the file.
