Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How can I make search only show products with all words Rate Topic   - - - - -

 
  • clips
  • Aged Resident Loon
  • Members
  • Join Date: 14-Jan 07
  • 1650 posts

Posted 24 August 2008 - 09:00 PM #21

Not working for me. and i am using the newest version of cscart


Are you maybe doing an edit on the wrong skin? We had no problem and we are using the latest version too.

Can you provide more info as to what you did and maybe a site? There are a lot of good people here in the forum so someone may be able to direct you.
Regards,
Jim

 
  • 12voltshop
  • Member
  • Members
  • Join Date: 29-Feb 08
  • 64 posts

Posted 29 August 2008 - 10:48 AM #22

AH!!!
I know what you are all doing wrong!

The list is in order. It needs this perameter to be loaded before the others are taken into account. So it should be at the top of the list not added to the bottom.

Paste

<input type="hidden" name="match" value="all" />

at the top of the list just below

<form action="{$index_script}" name="search_form" method="get">




This makes it the first call and this solves it.

Hope this helps guys

Dan

 
  • mdekok3000
  • Senior Member
  • Members
  • Join Date: 06-Feb 08
  • 883 posts

Posted 29 August 2008 - 03:31 PM #23

Well it works at the bottom for me.
[SIZE=2]
[/SIZE]

 
  • 12voltshop
  • Member
  • Members
  • Join Date: 29-Feb 08
  • 64 posts

Posted 01 September 2008 - 09:07 AM #24

Well it works at the bottom for me.



Depends on the server and how litterally it takes it into account i suppose. I found it works at the bottom on the heart server but not on my bluehost one. Its mad. If someone could explain why this is then please let me know it might answer a few other questions lol

Dan ;)

 
  • javas
  • Member
  • Members
  • Join Date: 15-Sep 08
  • 39 posts

Posted 20 October 2008 - 04:42 AM #25

I am having the opposite problem. I have a search by product feature, and when someone checks off more than one checkbox, the only results I get have ALL of the checked features. What I need is for the search to return products with ANY of the features checked off. I've added the "match" field to the form, set to "any", but I get the same results.

You can see this at www.plans2build.com. Any ideas on how to fix this? Thanks!

 
  • njd76
  • Junior Member
  • Members
  • Join Date: 19-Oct 07
  • 15 posts

Posted 09 January 2009 - 10:11 PM #26

Sorry just taken a look at it and I think I didn't word my request very well.

What I actually wanted to ask was how to get the search box that is permanently at the top of the screen to search using match type all.

Applying the info you gave me I have got it working now, so thanks again, but thought I'd post to let others know what I did.

I added this line as a hidden field to skins/basic/customer/side_boxes/search.tpl

<input type="hidden" name="match" value="all" />


Pretty simple but I just need pointing it the right direction.

Cheers


Thanks! I just did this mod and it worked out wonderfully, and the front page (side box) search function now does exactly what I need it to do. With this and the advanced search default being set to "all" terms, the CS cart search function is greatly improved.

-Nate

 
  • Eddy
  • Member
  • Members
  • Join Date: 08-Nov 07
  • 37 posts

Posted 17 June 2009 - 08:50 PM #27

How to you do with Cs-cart 2.04?

I want to search exact in the Product name and the Search words only. I don't want it searches in short and full description.

Here are some adjust I made to search Exact in the Quick search and search by product code but it doesn't work well

---------------Original code----------------------
// Search string condition for SQL query
if (!empty($params['q'])) {

if ($params['match'] == 'any') {
$pieces = explode(' ', $params['q']);
$search_type = ' OR ';
} elseif ($params['match'] == 'all') {
$pieces = explode(' ', $params['q']);
$search_type = ' AND ';
} else {
$pieces = array($params['q']);
$search_type = '';
}

$_condition = array();
foreach ($pieces as $piece) {
$tmp = db_quote("(descr1.search_words LIKE ?l)", "%$piece%"); // check search words

if ($params['pname'] == 'Y') {
$tmp .= db_quote(" OR descr1.product LIKE ?l", "%$piece%");
}

-------------------Adjusted code--------------------------------------

// Search string condition for SQL query
if (!empty($params['q'])) {

if ($params['match'] == 'exact') {
$pieces = explode(' ', $params['q']);
$search_type = ' OR ';
} elseif ($params['match'] == 'all') {
$pieces = explode(' ', $params['q']);
$search_type = ' AND ';
} else {
$pieces = array($params['q']);
$search_type = '';
}

$_condition = array();
foreach ($pieces as $piece) {
$tmp = db_quote("(descr1.search_words LIKE ?l)", "%$piece%"); // check search words

if ($params['pname'] == 'Y') {
$tmp .= db_quote(" OR descr1.product LIKE ?l", "%$piece%");
}

if ($params['pname'] == 'Y') {
$tmp .= db_quote(" OR products.product_code LIKE ?s", "%$piece%");
}

Any one can help me?

 
  • baballuci
  • Senior Member
  • Members
  • Join Date: 02-Mar 06
  • 969 posts

Posted 18 June 2009 - 05:40 PM #28

You should be looking in YOUR_SKIN/customer/common_templates/search.tpl. At the top of the page add/change the following red parts:
<form action="{$index_script}" name="search_form" method="get">
<input type="hidden" name="subcats" value="Y" />
<input type="hidden" name="type" value="extended" />
<input type="hidden" name="status" value="A" />
<input type="hidden" name="pshort" value="[COLOR="Red"]N[/COLOR]" />
<input type="hidden" name="pfull" value="[COLOR="Red"]N[/COLOR]" />
<input type="hidden" name="pname" value="Y" />
<input type="hidden" name="pkeywords" value="Y" />
[COLOR="Red"]<input type="hidden" name="match" value="exact" />[/COLOR]
{hook name="search:additional_fields"}{/hook} 

Charlie

 
  • Eddy
  • Member
  • Members
  • Join Date: 08-Nov 07
  • 37 posts

Posted 18 June 2009 - 09:05 PM #29

You should be looking in YOUR_SKIN/customer/common_templates/search.tpl. At the top of the page add/change the following red parts:

<form action="{$index_script}" name="search_form" method="get">
<input type="hidden" name="subcats" value="Y" />
<input type="hidden" name="type" value="extended" />
<input type="hidden" name="status" value="A" />
<input type="hidden" name="pshort" value="[COLOR="Red"]N[/COLOR]" />
<input type="hidden" name="pfull" value="[COLOR="Red"]N[/COLOR]" />
<input type="hidden" name="pname" value="Y" />
<input type="hidden" name="pkeywords" value="Y" />
[COLOR="Red"]<input type="hidden" name="match" value="exact" />[/COLOR]
{hook name="search:additional_fields"}{/hook} 


Many thanks baballuci. Many thanks

I tried and it works well for me.

But when I turn the Setting: Search also in Pages and Site News, it behaves stranged
The result is not perfect.

Any idea?

 
  • Alfie
  • Senior Member
  • Members
  • Join Date: 06-Jun 06
  • 132 posts

Posted 16 December 2009 - 07:18 PM #30

:D :D :D :D

Stumbled accross this thread purely by accident, but has been something that has bugged me for so long. There is only so much that can be done by tweaking the search phrases!

Customers reach my site in a host of different ways, not necessarily via the product page they want, so making a search facility that would enable them to easily find what they needed was imperative.

I'm forever greatfull and can really see this helping turn visitors into paying customers.

Thanks

Alfie

 
  • russ1106
  • Member
  • Members
  • Join Date: 09-Oct 07
  • 54 posts

Posted 08 July 2010 - 01:57 AM #31

Yes, thank you also. This was something bugging me for awhile also but I forgot to look it up to fix it. Fixed.

 
  • idg
  • Member
  • Members
  • Join Date: 22-Jul 09
  • 75 posts

Posted 13 July 2010 - 03:26 PM #32

How you I get cs cart to search all words but it should match each word exact. So for example if I search mens shoes right now it's returning womens shoes also as it is partially matching "mens" in the word womens. However I want it to search all words too. It seems you can't tell cs cart to do this by default.

 
  • tmhs
  • Member
  • Members
  • Join Date: 23-Oct 07
  • 63 posts

Posted 08 September 2010 - 12:58 AM #33

Sorry just taken a look at it and I think I didn't word my request very well.

What I actually wanted to ask was how to get the search box that is permanently at the top of the screen to search using match type all.

Applying the info you gave me I have got it working now, so thanks again, but thought I'd post to let others know what I did.

I added this line as a hidden field to skins/basic/customer/side_boxes/search.tpl

<input type="hidden" name="match" value="all" />


Pretty simple but I just need pointing it the right direction.

Cheers


Ran a store for 3 years and the search bugged the life out of me. Was useless to be fair.

This fix on a client's store has finally made the search work.

Forever grateful :D Wish I'd got it 3 years ago! lol
1.3.5 SP2 - Was Bugged...but support really pulled through on this one :D