Currently, when using the search bar to search for products, if the user does not input text in the currently active language (let's say English), but in stead, inputs text in any of the other avaiable languages (for example, Russian), then the search will result in nothing being found.
Despite the product that coresponds with the search query being in stock, avaiable and having description translated in multiple-languages, OpenCart only looks for text in the active language translation and only text that matches the search query.
Ideally, I would like to allow users to write their search query in any of the avaiable languages... no matter which one is the active one currenlty and be able to find products.
Any ideas how to accomplish this?
I have looked into the OpenCart support forum and people recommended to modify the product.php (catalogue) file function that supposedly contains the sql queries for fetching products based on search bar input.
For example, inside the getProducts() function I changed the following code...
Code: Select all
$sql = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
Code: Select all
$sql = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id);
It is possible that the Journal 3 theme has it's own files that modify the default search functionality. Yet, the Journal theme documentation states (might be wrong) that Journal 3 uses the default built-in search functionality of OpenCart 3. Thus, modifying the default code responsible for searching prodcuts, should do the trick.
Yet, nothing I have tried, has enabled my site to allow multi-language product search.