X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Search Modification (https://forum.x-cart.com/showthread.php?t=1757)

funkydunk 03-06-2003 01:55 AM

Search Modification
 
Just a simple work around for when a customer searches for say laptops and you have loads of product defined as laptop computer. In this instance nothing would show in the results.

This strips the s of the end for the search:

Add into customer/search.php below the:

#
# Perform SQL search query
#

if(!$substring) { $substring = $substring_sku; }

bit.

Code:

        // code to strip last s from search string
        $substring = trim($substring);
        $start = (strlen($substring)-1);
        if ((substr($substring,$start,1)=="s")||(substr($substring,$start,1)=="S")){
        $substring = substr($substring,0,$start);
        }


the searches for laptops will show up anything that is a laptop

Obviously it doesn't only work for laptops :wink:

Raju Naik 03-07-2003 04:30 AM

I'm seeing squares in .php files
 
:(

I tried your suggested idea of getting rid of 's' at end of search words,
but when I tried to edit the /customer/search.php file, I found strange
rectangle symbols all over the place. It just looks a mess.

Do you need a special editor?

Regards

Raj

funkydunk 03-07-2003 04:32 AM

what were you editting it in?

Raju Naik 03-07-2003 07:17 AM

Seeing squares
 
I'm using the standard editor that comes with WS_FTP.

It seems to run notepad.exe.

Is there a better editor available?

funkydunk 03-07-2003 07:19 AM

Try opening it up in Notepad or Dreamweaver or ultraedit and it should be fine.

Raju Naik 03-07-2003 08:02 AM

Normality Resumed
 
:oops:

I was doing a binary transfer of the PHP files and hence the squares & strange symbols.

Thanks for your help.

funkydunk 03-07-2003 08:09 AM

ahhh.. I should have spotted that aswell :oops:


All times are GMT -8. The time now is 07:00 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.