You are here:  » browse / search by new "category" similar to "brand"

Support Forum



browse / search by new "category" similar to "brand"

Submitted by haggle on Sat, 2010-06-05 08:55 in

Dave,

I tried to add a "browse by colour" search option to my Price Tapestry installation.

See: http://art.hagoole.com.au/colour.php

Dave would you be kind enough to help out for though I read partially similar posts I could not succeed in specifically applying it to my needs.

The database fields seem to be installed and working correctly.

You may see the fields working in this example:

http://art.hagoole.com.au/products.php?q=Ondine+diptych

Would I be better of running filters for words in the "colour" field?

The error I currently get is pasted below:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data/home/prowler777/websites/art.hagoole.com.au/docs/includes/database.php on line 27

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /data/home/prowler777/websites/art.hagoole.com.au/docs/includes/database.php on line 32

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data/home/prowler777/websites/art.hagoole.com.au/docs/includes/database.php on line 27

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /data/home/prowler777/websites/art.hagoole.com.au/docs/includes/database.php on line 32

Submitted by support on Mon, 2010-06-07 08:54

Hi,

It looks like you may have missed the new "colour" field out of the $fields array in search.php. To add "colour" as a search field, the replacement would be to look for the following code beginning at line 58:

      case "merchant":
        // pass through to category
      case "category":
        // pass through to brand
      case "brand":
       $fields = array("merchant","category","brand");

...and REPLACE with:

      case "colour":
      case "merchant":
        // pass through to category
      case "category":
        // pass through to brand
      case "brand":
       $fields = array("merchant","category","brand","colour");

I think it's just the last line of the above that hasn't been modified in your version, because it's obviously trying to search by colour, but then not using it in the construction of the SQL...

Hope this helps!

Cheers,
David.

Submitted by haggle on Mon, 2010-06-07 15:07

FIXED!!!

Dave your the man!

thanku