I have found this dose not affect "description" but ruins "model" "sku' and "tag" search.
Many customers will cut and paste these values. If they pick up a leading or trailing space they will see no results.
Is there a way to remove any spaces front and back.
Many customers will cut and paste these values. If they pick up a leading or trailing space they will see no results.
Is there a way to remove any spaces front and back.
Last edited by harleybill on Mon Aug 15, 2011 7:30 am, edited 1 time in total.
Harleybill
http://spaparts1.com
To fix, in catalog/model/catalog/product.php
find:
add after:
find:
add after:
find:
Code: Select all
if (isset($data['filter_name']) && $data['filter_name']) {
Code: Select all
$data['filter_name'] = trim($data['filter_name']);
Code: Select all
if (isset($data['filter_name'])) {
Code: Select all
$data['filter_name'] = trim($data['filter_name']);
I really want to add this fix to my site, but I can find any reference to "filter" in the catalog/model/catalog/product.php file. I am using 1.4.9.3. Does this fix apply to this version?
I believe it's $keyword in 1.4.9.3 (although I only started using OC at 1.5.x)
It's in the same file, but in a different function.
find:
add after:
It's in the same file, but in a different function.
find:
Code: Select all
public function getProductsByKeyword($keyword, $category_id = 0, $description = FALSE, $model = FALSE, $sort = 'p.sort_order', $order = 'ASC', $start = 0, $limit = 20) {
if ($keyword) {
Code: Select all
$keyword = trim($keyword);
Thank you for your information. It really seems like this should work, but I get the same wrong results as before. Is there another place I should be looking?
for 1.5.1.3
edit: catalog/model/catalog/product.php
find 2 ocurrences of
add after both occurrences
edit: catalog/model/catalog/product.php
find 2 ocurrences of
Code: Select all
if (!empty($data['filter_name']) || !empty($data['filter_tag'])) {
Code: Select all
$data['filter_name'] = trim($data['filter_name']);
I put the new codes in both places, but still have the spacing issue. Please go to my website: http://lenobe.com
You can try: 02-AZ-AI98-PCC-RIM with and without space on the header search function. Let me know if you have any insight.
Thanks again.
You can try: 02-AZ-AI98-PCC-RIM with and without space on the header search function. Let me know if you have any insight.
Thanks again.
Hi
Undo the change above
then
edit: catalog/controller/product/search.php
find
change to
Undo the change above
then
edit: catalog/controller/product/search.php
find
Code: Select all
if (isset($this->request->get['filter_name'])) {
$filter_name = $this->request->get['filter_name'];
} else {
$filter_name = '';
}
if (isset($this->request->get['filter_tag'])) {
$filter_tag = $this->request->get['filter_tag'];
} elseif (isset($this->request->get['filter_name'])) {
$filter_tag = $this->request->get['filter_name'];
} else {
$filter_tag = '';
}
Code: Select all
if (isset($this->request->get['filter_name'])) {
$filter_name = trim($this->request->get['filter_name']);
} else {
$filter_name = '';
}
if (isset($this->request->get['filter_tag'])) {
$filter_tag = $this->request->get['filter_tag'];
} elseif (isset($this->request->get['filter_name'])) {
$filter_tag = trim($this->request->get['filter_name']);
} else {
$filter_tag = '';
}
Who is online
Users browsing this forum: Ahrefs [Bot] and 44 guests