Post by pedram672004 » Wed Oct 15, 2014 2:58 pm

Hi to all.
Thanks for your great cms.
I have request, It is possible to make opencart Internal search Engine, Search in tags or meta keywords more than one word?
For example:
I taged a product with:
harry, john, rayan.
When I search: Rayan
Its works well and show product.
But when I search: rayan harry
Or harry rayan
getting no result and shows nothing.
Thanks again.
I uses Opencart 1.5.5.1

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by pedram672004 » Sat Oct 18, 2014 1:23 pm

no one can help me?

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by pedram672004 » Mon Oct 20, 2014 2:51 pm

If Anyone can do something I can pay as well.

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by chrisranjana.com » Mon Oct 20, 2014 4:48 pm

pedram672004 wrote:................., Search in tags....................
For tags alone

In file /catalog/model/catalog/product.php

change the following snippet of code where ever it appears

Code: Select all

if (!empty($data['filter_tag'])) {
				$sql .= "pd.tag LIKE '%" . $this->db->escape($data['filter_tag']) . "%'";
			}

so that it splits(explodes) the $data['filter_tag'] into an array and then passes each of the array element into the sql "like" statement.

Chris, Opencart Developers and Programmers,
Opencart Developers Opencart Programmers
https://www.chrisranjana.com


User avatar
Active Member

Posts

Joined
Thu Feb 26, 2009 2:23 am
Location - chennai, India

Post by pedram672004 » Mon Oct 20, 2014 10:36 pm

Hi, Thanks for help.

I find section in proudct.php

First in line:
136~ 138

Code: Select all

			if (!empty($data['filter_tag'])) {
				$sql .= "pd.tag LIKE '%" . $this->db->escape($data['filter_tag']) . "%'";
			}
And In line 537~539

Code: Select all

			if (!empty($data['filter_tag'])) {
				$sql .= "pd.tag LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_tag'])) . "%'";
			}

Change these code to what?
Sorry I'm confused. A Exempla is preferred (sorry!)

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by granddaddy » Tue Oct 21, 2014 12:53 am


Active Member

Posts

Joined
Sat Feb 18, 2012 5:48 pm

Post by pedram672004 » Wed Oct 22, 2014 12:01 am

@grandaddy
Thanks for help
I read that post and it said it is fix for 1.5.3.1 and even "Qphoria" said:
DO NOT USE THIS FILE UNLESS YOU ARE USING v1.5.1.3
FUTURE VERSIONS WILL ALREADY HAVE THIS FIX AND OTHER CHANGES.
I don't have idea what should I do~ ??? :'(
Last edited by pedram672004 on Wed Oct 22, 2014 12:21 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by granddaddy » Wed Oct 22, 2014 12:12 am

Yes, I recall Qphoria saying that initially, but I think he later said that it might not actually be fixed in later versions. I believe Qphoria works directly on the development of Opencart so it might be a good idea if you pm'd him (quoting the thread) to ask if that "search fix" was actually implemented at any stage.

Active Member

Posts

Joined
Sat Feb 18, 2012 5:48 pm

Post by pedram672004 » Wed Oct 22, 2014 3:14 pm

I sent him a pm about problem and it seems I must wait until see whats outcome.
And also tested that fix and although its says it is for 1.5.3.1 and not working at all in 1.5.5.1 ( to be specified there are just two times and not :
It should match 4 times.
of this code:

Code: Select all

$sql .= " " . implode(" OR ", $implode) . "";
And also I attached my "product.php" to this post, might be helpful.

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by granddaddy » Wed Oct 22, 2014 3:44 pm

You are right - your product.php is very different from earlier versions, so that fix cannot be used in 1.5.5.1.
I've looked at your product.php and I cannot see any reason it should not be working. The code for searching tags looks okay to me.
Sorry I can't be of more help, but perhaps someone else reading this can have a look at the code?

Active Member

Posts

Joined
Sat Feb 18, 2012 5:48 pm

Post by pedram672004 » Wed Oct 22, 2014 8:03 pm

Thanks granddady, for your help and for your time, At first sight, I think, maybe it's character setting (cause i used non ASCII character for tags and other stuff) but even when use ASCII character, Still getting no result.

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by pedram672004 » Sun Oct 26, 2014 4:31 pm

Still no answer~ ;(

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by granddaddy » Sun Oct 26, 2014 6:28 pm

Perhaps you could try asking the question again in the Commercial section of the forum. You said you'd be willing to pay if necessary, and someone there might be willing to help out.

Active Member

Posts

Joined
Sat Feb 18, 2012 5:48 pm

Post by pedram672004 » Sun Oct 26, 2014 8:01 pm

Yeah of course, I find this out yesterday, its funny when you add a product with harry rayan tags without "," and search For example:
rayan or harry, Its works and If you search for "rayan harry" doesn't work.
I created a ticket in commercial section and see what happened.

-------------------------------
commercial section:
http://forum.opencart.com/viewtopic.php?f=88&t=132992

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm

Post by gtoc » Sun Nov 02, 2014 5:58 am

Did anyone have any luck with this. I would really like to be able to explode Tags in search like you can with product name.

New member

Posts

Joined
Tue Apr 23, 2013 12:11 pm

Post by pedram672004 » Wed Nov 05, 2014 6:01 pm

but It seems no one can do it.

Newbie

Posts

Joined
Wed Oct 15, 2014 2:48 pm
Who is online

Users browsing this forum: Amazon [Bot] and 1 guest