Open ioweb-gr opened 2 years ago
Any ideas where I should start looking for it?
making some tests i detect that magento will allways convert the simbols into unicode for searching, try making the same method, convert the symbols to the unicode and search for then:
// app/code/core/Mage/CatalogSearch/Helper/Data.php
<?php
// ...
public function getQuery()
{
if (!$this->_query) {
$this->_query = Mage::getModel('catalogsearch/query')
- ->loadByQuery($this->getQueryText());
+ ->loadByQuery(htmlentities($this->getQueryText()));
if (!$this->_query->getId()) {
- ->loadByQuery($this->getQueryText());
+ ->loadByQuery(htmlentities($this->getQueryText()));
}
}
return $this->_query;
}
Remember to add the targets attributes on the search filter.
The problem is that if we don't use the wysiwyg editor, the characters are not encoded, and they work fine in search. Doing this, will make other attributes not work like the product name for examle :(
u can do a special rule for this symbols like a str_replace([symbols], [encode], string_search);
Preconditions (*)
Steps to reproduce (*)
Create a simple product that's in stock, has quantity, is visible in catalog and search.
Add to it a description like
![image](https://user-images.githubusercontent.com/20220341/144711995-e11865b5-d557-47f3-87ac-a174525157e0.png)
Φώτα θέσεως
using the wysiwyg editor. The description is going to be saved encoded in html entities like this<p>Φώτα θέσεως</p>
Reindex and clear cache
Go to the frontend and search for the word
Φώτα
Expected result (*)
Actual result (*)
It seems that OpenMage is not building the search index correctly or during search it forgets to encode or decode the html entities.