You are here:  » Specific Field Search

Active Forum Topics


Specific Field Search

Submitted by philstone on Wed, 2015-12-16 11:24 in

Hi David

Is there a way to search for a specific field?

I know for merchant, brand and category we just enter eg: "Brand:search Term" into the search bar.

so I was wondering if I wanted to search for a term in the model or mpn fields only is this possible? without searching all other fields?

Thanks

Phil

Submitted by support on Wed, 2015-12-16 11:31

Hello Phil,

Sure - in search.php look for the following code around line 127:

      case "brand":
        if ($config_useCategoryHierarchy)
        {
          $fields = array("merchant","brand");
        }
        else
        {
          $fields = array("merchant","category","brand");
        }

...and REPLACE with:

      case "brand":
      case "model":
      case "mpn":
        if ($config_useCategoryHierarchy)
        {
          $fields = array("merchant","brand","model","mpn");
        }
        else
        {
          $fields = array("merchant","category","brand","model","mpn");
        }

This will add support for model:Model and mpn:MPN etc. exactly as per merchant: / brand:...

Cheers,
David.
--
PriceTapestry.com

Submitted by philstone on Wed, 2015-12-16 13:15

Thanks David

That works perfectly!!

Phil