Support forum login

©2006-2012 IAAI Software

Contact Us Privacy Policy

Search within a brand

Submitted by kiddaclo on Wed, 2010-03-17 12:52.

Hi,

Is it possible with search external to search for products within a brand so something like "brand:sony&tv" ?

Cheers,
Chris.

Submitted by support on Wed, 2010-03-17 14:09.

Hi Chris,

Sure - it's straight forward to add the the brand: search handler. In search.php, look for the following code on line 64:

          $fields = array("merchant","category","brand");

...and REPLACE with:

          $fields = array("merchant","category","brand","name");

And then look for the following code on line 94:

          $where .= " ".$field." = '".database_safe($parts[$i])."' ";

...and REPLACE with:

          if ($field == "name")
          {
            $where .= " ".$field." LIKE '%".database_safe($parts[$i])."%' ";
          }
          else
          {
            $where .= " ".$field." = '".database_safe($parts[$i])."' ";
          }

With that in place, you can then search using, for example:

brand:sony:name:tv

Alternatively, as would already be in place without the above modifications; you can always link to:

brand:sony:category:Televisions

etc.

Cheers,
David.

Submitted by kiddaclo on Wed, 2010-03-17 19:55.

Hi David,

That works great within Price Tapestry but doesn't seem to work with searchExternal.php
I'm calling it with the normal:

<?php
  $common_baseHREF 
"http://www.example.com/pricetapestry/";
  
$common_path "/path/to/pricetapestry/";
  
$_GET["q"] = "brand:sony:name:tv";
  require(
$common_path."searchExternal.php");
?>

Cheers,
Chris.

Submitted by support on Thu, 2010-03-18 09:47.

Hi Chris,

searchExternal.php contains the full search logic in its own right so the same modification would be required in that file. The corresponding lines are 118 for the first modification; and 142 for the second. If you're not sure, email me the searchExternal.php that you are using and I'll make the changes for you..

Cheers,
David.

Submitted by kiddaclo on Fri, 2010-03-19 16:34.

Cheers David.

Submitted by kiddaclo on Tue, 2010-03-23 20:15.

Hi David,

I have read a few times on the forum about a searchExternal that includes pagination and also one that includes products displayed in a grid format is there a searchExternal available that combines both the grid format and pagination?

Cheers,
Chris.

Submitted by support on Wed, 2010-03-24 09:10.

You'll need the full external.php to do that; i'll email it to you now along with the grid version of the search results HTML module...

Cheers,
David.

Submitted by kiddaclo on Tue, 2010-04-13 09:48.

Hi David,

Would it be possible to incorporate another field from my feeds in PT? I have a field which is 'gender' and a I'd love to be able to search externally for something like:
brand:blah:category:blah blah:gender:womens

Cheers,
Chris.

Submitted by support on Wed, 2010-04-14 06:47.

Hello Chris,

Sure - if you could email me your search.php and external.php (if you want the same functionality in that) i'll add the code for you...

Cheers,
David.