Hi there - I'm new to OpenCart, but not a programming dummy - I'm familiar enough with OC and proficient enough with PHP to understand modification techniques - I've done quite a bit myself, but I'm having some difficulty adding "sku" to the search function - I don't need to add a choice, just have the search function always search in sku field, as well. help? I have version 1.4.x - not sure the exact version.
(v1.5.1.3)
1. EDIT: catalog/model/catalog/product.php
2. FIND (4 times) EXACTLY:
3. GLOBAL REPLACE WITH:
1. EDIT: catalog/model/catalog/product.php
2. FIND (4 times) EXACTLY:
Code: Select all
LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'
Code: Select all
LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%' OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'
I'm seeing twice the pd.name field in the LCASE ...
I believe it would be:
to search by product name or product sku.
For models along with the product name and sku, it would be like:
for future reference.
I believe it would be:
Code: Select all
LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%' OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'
For models along with the product name and sku, it would be like:
Code: Select all
LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%' OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%' OR LCASE(p.model) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
the second one, (by straightlight ) worked with some modifications
1) the function "utf8_strtolower" had to be changed to "strtolower" and
2) $word is $keyword
so, now to find the same deal for admin searches... erg....
Thanks to both of you very much for the help - a quick pointer to finding this search in admin would be more then gracious of you....
1) the function "utf8_strtolower" had to be changed to "strtolower" and
2) $word is $keyword
so, now to find the same deal for admin searches... erg....
Thanks to both of you very much for the help - a quick pointer to finding this search in admin would be more then gracious of you....
Who is online
Users browsing this forum: No registered users and 17 guests