[SOLVED] OC 4.1.0.3 Search is broken
Posted: Mon Apr 21, 2025 11:25 pm
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
HTH
In the mean time, to keep a reduce search, one could comment out the block from line 359 of catalog/model/catalog/product.phpError: Unknown column 'p.sku' in 'where clause'
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'])) . "'";
// }