Page 1 of 1

[SOLVED] OC 4.1.0.3 Search is broken

Posted: Mon Apr 21, 2025 11:25 pm
by CedSha
As far as I can understand there was an update on how the columns sku, upc, ean, jan, isbn, mpn are handled. They are no more parts of the main oc_product table, but now belongs to oc_product_code table. If so we need to join this table to search inside, else get an error
Error: Unknown column 'p.sku' in 'where clause'
In the mean time, to keep a reduce search, one could comment out the block from line 359 of catalog/model/catalog/product.php

Code: Select all

//if (!empty($data['filter_search'])) {
//    $sql .= " OR LCASE(`p`.`model`) = '" . $this->db->escape(oc_strtolower($data['filter_search'])) . "'";
//    $sql .= " OR LCASE(`p`.`sku`) = '" . $this->db->escape(oc_strtolower($data['filter_search'])) . "'";
//    $sql .= " OR LCASE(`p`.`upc`) = '" . $this->db->escape(oc_strtolower($data['filter_search'])) . "'";
//    $sql .= " OR LCASE(`p`.`ean`) = '" . $this->db->escape(oc_strtolower($data['filter_search'])) . "'";
//    $sql .= " OR LCASE(`p`.`jan`) = '" . $this->db->escape(oc_strtolower($data['filter_search'])) . "'";
//    $sql .= " OR LCASE(`p`.`isbn`) = '" . $this->db->escape(oc_strtolower($data['filter_search'])) . "'";
//    $sql .= " OR LCASE(`p`.`mpn`) = '" . $this->db->escape(oc_strtolower($data['filter_search'])) . "'";
// }
HTH

Re: OC 4.1.0.3 Search is broken

Posted: Mon Apr 21, 2025 11:49 pm
by khnaz35
Feel free to report your issue here.
https://github.com/opencart/opencart/issues

[SOLVED] Re: OC 4.1.0.3 Search is broken

Posted: Tue Apr 22, 2025 4:31 am
by CedSha
The bug was referenced as #14746 in Github
First I did not find it as they do not mention the 'search' term in the title ;D
I tried the committed file in d9714d1 which perfectly solved the problem.
Tks

Re: [SOLVED] OC 4.1.0.3 Search is broken

Posted: Thu May 29, 2025 12:47 am
by agenziarc@yahoo.com
Can you tell me the exact solution to the problem?

Re: [SOLVED] OC 4.1.0.3 Search is broken

Posted: Thu May 29, 2025 2:16 am
by khnaz35
Here is the solution to the problem
https://github.com/opencart/opencart/co ... 96a39bcebf

Re: [SOLVED] OC 4.1.0.3 Search is broken

Posted: Thu May 29, 2025 9:49 pm
by agenziarc@yahoo.com
khnaz35 wrote:
Thu May 29, 2025 2:16 am
Here is the solution to the problem
https://github.com/opencart/opencart/co ... 96a39bcebf
OK Thank you