You are here:  » Subdomains - Master Search, Merchant & Brand Page


Subdomains - Master Search, Merchant & Brand Page

Submitted by chessyb on Thu, 2016-07-21 14:31 in

Hi David,

If I have multiple subdomain installations, each with a number of stores, with a number of them appearing on several subdomains, with a mixture of different products and some products that are the same. Would it be possible to have a master search that searches all the subdomains, drops any duplicate products and then presents the result like a normal search and a master merchant a-z and brand a-z pages that covers all subdomains?

I tried the 'Multiple Site Search' download for search, but it wasn't what I was looking for.

Thanks,

- Quentin

Submitted by support on Fri, 2016-07-22 08:54

Hi Quentin,

As a starting point, sitesearch.php can be made to work across subdomains by firstly changing the folder name within the $sites array beginning at line 2 to the full file system path to the installation, e.g;

  $sites["Category Name 1"] = "/home/example/subdomains/category-1/";
  $sites["Category Name 2"] = "/home/example/subdomains/category-2/";

And then a corresponding array created with a fully qualified base HREF to each installation e.g;

  $baseHREF["Category Name 1"] = "http://category-1.example.com/";
  $baseHREF["Category Name 2"] = "http://category-2.example.com/";

With that in place, look for the following code at line 155:

print "<li><a href='".$sites[$site]."search.php?q=".urlencode($q)."'>".$site."</a> (".$count.")</li>";

...and REPLACE with:

print "<li><a href='".$baseHREF[$site]."search.php?q=".urlencode($q)."'>".$site."</a> (".$count.")</li>";

Regarding presentation of results as normal search results with de-duplication (which can become very complicated!) does the main page (e.g. www. site) have a Price Tapestry installation in place? This could also be used to create the master merchant / brand A-Z pages...

Cheers,
David.
--
PriceTapestry.com

Submitted by chessyb on Fri, 2016-07-22 09:14

Hi David,

Yes, the main page does also have a Price Tapestry installation.

Thanks,

- Quentin

Submitted by support on Fri, 2016-07-22 10:20

Hi Quentin,

I'm happy to guide you through this step-by-step but would be easier via email if that's OK - if you could email me sitesearch.php modified and working for subdomains as described above I'll pick it up from there with you...

Thanks,
David.
--
PriceTapestry.com

Submitted by marco.saiu on Thu, 2018-01-25 08:31

Hello David,

i see this for sitesearch.php and Brands and Merchants have version of this script for search Merchants or Brands in subdomains/folrdes?

Thanks,
Marco Saiu

Submitted by support on Thu, 2018-01-25 09:13

Hi Marco,

To do the same as above you will need to have a Price Tapestry installation in the top level folder (only for the files, it won't use the database at all), so if that's OK, if you could first set that up and also make sure that site search is working across at least 2 installations and then if you could email me the working sitesearch.php the first thing I'll do is to split it into separate config and search files, and the config file can then be used by the A-Z indexes to show merchants for all sub-directories...

Cheers,
David.
--
PriceTapestry.com