I am using opencart 3.0.3.2 with Journal 3 and I have problem with seach products when i use SKU number.
There is a product in Catalog with SKU with number 50131001B - when i search it everything is fine, but when i try to search with only part of that SKU for example 50131001 or 50131 search results show me that there is no products with this matching criteria. Is there anyway to change that "exact match" with logic to search even i've entered a part of it.
Thanks in advanced to everyone
Code: Select all
$sql .= " OR LCASE(p.sku) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
Code: Select all
$sql .= " OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
same change, you have to keep these two functions in sync.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I've disabled and also change both methods in catalog/product.php with
Code: Select all
$sql .= " OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
But still product doesn't appear in search without B in the sku
Ok .. i change the SKU to Model .. trying to do the same with the model with like '%" method but still nothing
Code: Select all
$sql .= " OR LCASE(p.sku) LIKE '%" . str_replace(' ', "%' OR LCASE (p.sku) LIKE '%", $data['filter_name']) . "%'";
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Code: Select all
error_log($sql);
Code: Select all
$this->log->write($sql);
just before
Code: Select all
$query = $this->db->query($sql);
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
This one is though:
find around line 995 in /catalog/model/journal3/filter.php
$sql .= " OR LCASE(p.sku) = '" . $this->db->escape(utf8_strtolower($filter_data['filter_name'])) . "'";
and change to
$sql .= " OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($filter_data['filter_name'])) . "%'";
Web Development, Consulting and SEO for Europe by itech.bg
While the OC version has been unposted, Journal is unsupported on the forum in anyhow. Please contact Journal support for further assistance with Journal requests.aitechbg wrote: ↑Wed Feb 17, 2021 6:53 pmNone of above is working for Journal 3x
This one is though:
find around line 995 in /catalog/model/journal3/filter.php
$sql .= " OR LCASE(p.sku) = '" . $this->db->escape(utf8_strtolower($filter_data['filter_name'])) . "'";
and change to
$sql .= " OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($filter_data['filter_name'])) . "%'";
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: Amazon [Bot] and 81 guests