Post by masterbeta » Mon Feb 15, 2016 4:36 pm

so i have 2 languages on my opencart site, when in English i can search in English of course and see results in English....

when i search with other language, i can only search in that other language, i cannot search in English...

i would like to have that whatever language i have installed, to search with either language to return the same results in the current language - so for example, if i'm viewing the store in a foreign language, and i search in English, i would like the search to return the products in the current language instead of "0 products found" message.... i figured this should be a simple "fix" since the search controller parses the database - can anyone recommend a simple way to make this happen?

thanks

New member

Posts

Joined
Thu Nov 26, 2015 3:55 pm
Location - Ikaria, Greece

Post by masterbeta » Thu Feb 25, 2016 3:18 pm

on line 78 in model/catalog/product.php
i removed the language part of this:

Code: Select all

$sql .= " LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'";
to this:

Code: Select all

$sql .= " LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'";
now i can search whatever words in any language

New member

Posts

Joined
Thu Nov 26, 2015 3:55 pm
Location - Ikaria, Greece

Post by Nawid » Mon Jun 25, 2018 4:05 am

Thx, it works on Opencart Version 3.0.2.0

User avatar
New member

Posts

Joined
Fri Aug 19, 2011 6:47 am

Post by IP_CAM » Mon Jun 25, 2018 4:30 am

It also works in later 1.5.6.x Versions, as it looks. ;)
Just to have this mentioned too ...
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by gangerlino » Mon Feb 04, 2019 12:23 pm

Worked for opencart 2.3.0.2

Newbie

Posts

Joined
Thu Jan 24, 2019 11:09 am

Post by IliaM » Sun Aug 08, 2021 6:04 am

Hello,

I've modified lines mentioned above, but no changes yet.
Is there any time needed for changes?

Newbie

Posts

Joined
Thu Jun 10, 2021 8:16 pm

Post by thekrotek » Sun Aug 08, 2021 6:22 am

IliaM wrote:
Sun Aug 08, 2021 6:04 am
Is there any time needed for changes?
No, you just did it wrong.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by IliaM » Sun Aug 08, 2021 6:55 am

I double checked and it looks good. Clear caches is not helping as well. :(

Newbie

Posts

Joined
Thu Jun 10, 2021 8:16 pm

Post by thekrotek » Sun Aug 08, 2021 6:57 am

IliaM wrote:
Sun Aug 08, 2021 6:55 am
I double checked and it looks good. Clear caches is not helping as well. :(
Then it works fine, if you did everything right! Right???!

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by IliaM » Sun Aug 08, 2021 7:03 am

thekrotek wrote:
Sun Aug 08, 2021 6:57 am
IliaM wrote:
Sun Aug 08, 2021 6:55 am
I double checked and it looks good. Clear caches is not helping as well. :(
Then it works fine, if you did everything right! Right???!
No.
I did not say that I did everything right, I just said, that I change those code mentioned above.
I am just wondering if there is something else.

Newbie

Posts

Joined
Thu Jun 10, 2021 8:16 pm

Post by moshair » Fri Dec 03, 2021 5:04 am

Thx, it works on Opencart Version 3.0.3.8

New member

Posts

Joined
Sun Jul 21, 2019 3:27 pm
Who is online

Users browsing this forum: Bing [Bot] and 172 guests