Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Improved Search Function

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #131  
Old 05-28-2005, 01:16 AM
  CenturyPerf's Avatar 
CenturyPerf CenturyPerf is offline
 

eXpert
  
Join Date: Jun 2003
Location: Reno, Nevada
Posts: 396
 

Default

A couple errors in your code.

Lines 211, 212, 229 (you have [color] tags) that break the page.

Plus it still will not pull up Product SKUs (productcode).
__________________
Best Regards,

Sam Solace - Pres/CEO
Century Performance Center, Inc.
http://www.centuryperformance.com

(3) sites using X-Cart 5.3.5.5
X-Payments Enterprise 3.1.4
Reply With Quote
  #132  
Old 05-28-2005, 01:39 PM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default

Ok I removed the color Tag my bad I corrected this earlier but for some reason it did not update.

I also Tested the code out and had problems, fixed the problems somone please give me some feedback.

Also If you want SKU you need to add a check box or hidden input tag with the name "by_proudctcode" and give it any value and this will enable this feature.

I will be adding code to allow Simple Search on the home page to have all the features of advanced search
(minus categories and manufacutrers, this could be added but I dont need it for the simple search)
--------------------------------------------
I Updated my post again with the code for search_results.tpl and code to improve the simple search on the home page.
Hope thier are no bugs works good for me.
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote
  #133  
Old 06-07-2005, 08:55 PM
 
x-online x-online is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Australia, Sydney
Posts: 189
 

Default

Can you please put in on your code where exactly the file located? just for a newbie.

Also, SKU in advance page doesn't work (working fine in simple search). Can you please give a rough 'how to'?

here is my code:
Code:
<TD width="5"><INPUT type="checkbox" name="posted_data[by_title]"{if $search_prefilled eq "" or $search_prefilled.by_title} checked{/if}></TD><TD nowrap>{$lng.lbl_title}</TD> <TD width="5"><INPUT type="checkbox" name="posted_data[by_shortdescr]"{if $search_prefilled eq "" or $search_prefilled.by_shortdescr} checked{/if}></TD><TD nowrap>{$lng.lbl_short_description}</TD> <TD width="5"><INPUT type="checkbox" name="posted_data[by_fulldescr]"{if $search_prefilled eq "" or $search_prefilled.by_fulldescr} checked{/if}></TD><TD nowrap>{$lng.lbl_det_description}</TD> <input type="hidden" name="by_productcode" value"checked" {if $search_prefilled eq "" or $search_prefilled.by_productcode} checked{/if}>

Still doesn't work.

Thanks in advance!
__________________
X-Cart version 4.x (Most likely will be the latest version)
Reply With Quote
  #134  
Old 07-14-2005, 01:09 AM
  2019's Avatar 
2019 2019 is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 76
 

Default

hi there,

i got two questions.

1. any imporvements for 4.0.14


2. my store is based on Turkish Language. As Turkish use special charset like İĞц°Şц┤ when a customer search most of time search doesnt gets anything. it depens on if the word is writen with capital letters.
for example : our product is İzopermo

when the customer search for "izopermo" nothing found!
but when search with "İzopermo" capital first

search founds the product.

i hope i am clear with english.

any1 help? thnx
__________________
// x-cart 4.1.9

X-CART CSS SKIN
XC SEO
IP Addresses in Users Online for all users
Color coded order status
Reply With Quote
  #135  
Old 07-14-2005, 08:38 AM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default

This does sound like a BUGGER of a problem.
I wounder if you can use a regular expression to convert things???
If their is a logical convertion methode I am almost certain regex are perfect for just this type of task.

Or is their just a better way to handle the special character to begin with. Where everything is stored as "izopermo" then when smarty read/parses the text it converts this "i" to "İzopermo" for display

This does not suprize me though I am curious doesn't Russian have special characters? and well does the search engine work in their own language???

On second thought
Isn't İ an ASCII code???? Why wouldn't this be recognizeable
Im getting outa my league now.
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote
  #136  
Old 07-15-2005, 12:15 PM
 
marian marian is offline
 

Senior Member
  
Join Date: Mar 2005
Posts: 103
 

Default Oh No! Changed mind

This mod works.

However, if you want to change back to the original, the search for SKU in the advanced part is broken.

Yes I made backups of all 3 files. The customer decided that this wasn't what they wanted, I replaced the backups over the modified. And everything else works except the SKU line in the advanced. now this is in the admin area too. and that is where they need it the most.

any ideas like in the next 5 minutes???
__________________
Xcart Gold 4.0.13
OS: Linux
Apache version: 1.3.33 (Unix)
PHP version: 4.3.11
MySQL version: 4.0.22-standard
Reply With Quote
  #137  
Old 07-15-2005, 02:28 PM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default

Sound wierd. Sounds like you did not Restore the original files. Or you thought you restored a file and you restored the wrong one or something.

I would find the original files from a fresh install or freshly decompressed file.
Use these and you should be fine.

Check out My Mod Post on Page 9.
I have had several people tell me that this works just fine. I have zero problems with it if you want I can PM you my Copies of these files.

I made some minor changes to this post just now.
I set it up to display the search results as x-carts default methode rather than the search by term methode it was setup for.

Scott
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote
  #138  
Old 07-18-2005, 08:40 AM
 
marian marian is offline
 

Senior Member
  
Join Date: Mar 2005
Posts: 103
 

Default I got it working the old way again! :)

I restored the files from my last back up. However, I missed one file. xcart/include/search.php -- the most important one. I went crosseyed over this. Anyway, I did install this mod for another client and they love it. It works just fine. Thanks to ALL who contributed to this. Thank you so much Tuner for making it VERY clear and easy to make the modifications!!
__________________
Xcart Gold 4.0.13
OS: Linux
Apache version: 1.3.33 (Unix)
PHP version: 4.3.11
MySQL version: 4.0.22-standard
Reply With Quote
  #139  
Old 07-27-2005, 10:57 AM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default

Maybe Somone Can Help me hear. (sorry for the double post in wish list) I can delete it???

I think I got a hack that might work but could be slow. This would apply to the search modification that searches for products that contain any word in a search phrase. Currently x-cart only shows resluts that match ALL of the Words in your Search phrase.
(the mod under my Name Page 9 its defualt settings are to work like the normal x-cart search if you scroll 1/3 the way down you will see some commented out code follow the instruction to allow this mod to search by term rather than by phrase)


Not sure how to code this as of yet but hear is the concept.
Simply:
(use the seach mod and change commenting for term match)
1. Take the array of search results that are going to be displayed.
2. Add another element to the array so if the array is just ProductID then make it ProductID, Relevance.
3.Now Loop threw each ProductID For every Word that is found: Increment Relevance by 1.001 for the first time each word is found and increment Relevance by .001 for each additional match of that word.

So if one searches for "Ferrari 333 SP"

A. I have a product that has 3 occurances of "ferrari" and 2 occurances of "333" its relevancy score will be 2.005

B. I have a product that has 1 occurance "of ferrari" and 1 occurance of "333" and 1 occurance of "SP" its relevancy score will be 3.003

C. I have a product that has 4 occurances "of ferrari" and 3 occurances of "333" and 3 occurances of "SP" its relevancy score will be 3.010

D.I have a product that has 15 occurances of "ferrari" its relevancy score will be 1.015

Then If you sort by relevancy the results will be ordered as follows.
Products that Match all terms are listed first and those results will automaticly be orderd by the reoccurance of those matching terms.
(aka add 1 for each term that is matched and .001 for the total occuraces of all matched terms.)


If their are products where their is over 999 reoccurances of a Term this methode starts to fail( simply adding a decimal point will fix it up to 9,999 occurances) Probably dont need more than 99 but was playingit safe.

Should not be to hard to modify the existing code to do this.
If you do it right you just modify the current code that finds each term to update the Relevancy. Then you just add one Sort routine to sort the results by relevance.

Its a thought??? Maybe its easy to say hard to do???
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote
  #140  
Old 07-28-2005, 12:10 PM
 
colonial123 colonial123 is offline
 

Senior Member
  
Join Date: Jun 2005
Location: NH
Posts: 145
 

Default Sounds like it could work

Tuner that sounds like it could work.

I have a script that can search a phrase and return all the items that relate to the individual words of the string, but it cant handle sku's. X-Cart really needs to work on a better search engine.

let me know if you find a solution to this.

wmccoy@colonialmedical.com
__________________
William McCoy
Online Manager
Colonial Medical
Version 4.0.13
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:40 PM.

   

 
X-Cart forums © 2001-2020