©2006-2017 IAAI Software

Contact Us Privacy Policy

Multiple Site Search

Submitted by mikecdprice on Tue, 2014-09-23 05:30.

Hello,

Is it possible to install price tapestry for each merchant catalog where they would appear on the merchant page.

The user would click on the merchant, it would only show the merchants categories and the user can search the merchants catalog.

If they wanted to search ALL merchants (each on their own _prefix) is it possible it would show the results?

Is this possible?

Submitted by support on Tue, 2014-09-23 11:28.

Hello Mike,

Not easily I'm afraid - of course it could be done, but would require many conditional changes however there is possibly a much easier way to achieve what you want. You could create multiple installations of Price Tapestry, using sub-directories equivalent to the merchant name e.g.

/Merchant-A/
/Merchant-B/

etc..

...and then simply replace the index.php with the minimal code required to show all results, which is just:

<?php
  $_GET
["q"] = "bw:";
  require(
"search.php");
?>

Only minor modifications would then be necessary to your template, for example by removing the link to browse by merchant from html/searchform.php (if using 14/06A as your base, otherwise no changes required as the link is in index.php in earlier distributions).

If you are familiar with basic Linux server admin you could create a common top level /html/ folder so that you only need to maintain one copy of your template, for example with a layout that would look like:

/Merchant-A/
/Merchant-B/
/html/

And then replace the html/ sub-directory of each installation with soft link to the top level common version e.g.

html => ../html/

Let me know if you need any help setting that up of course if the above is something you'd like to try...

Cheers,
David.
--
PriceTapestry.com

Submitted by novashariff on Mon, 2015-04-27 08:41.

Hi David,

If i want to do the same for different categories and create different sub-folders for each category with price tapestry installation, do i have to do the same for database like create an new database or create tables in the same database with different prefix ?

i want to keep a common search for all categories, is it possible?

my second question is:

How will the feeds recognise the categories when we upload feeds? like in which category, as i will be creating my own categories. how to assign a feed to a particular category?

pls advice.

Submitted by support on Mon, 2015-04-27 08:56.

Hello novashariff, and welcome to the forum.

No need to create separate databases - in fact, it makes a common search much more straight forward. Instead, just use a different value for $config_databaseTablePrefix in each installation.

I will follow up to this reply shortly with generic common search code for the benefit of other users implementing this approach.

What I normally suggest with the multiple installation approach is to assign one installation as your "master" installation, and in this installation use the Automation Tool to manage jobs for all feeds, so it will only be your master installation that contains feeds in its /feeds/ folder.

Then, in your master installation, go the /admin/ > Tools > Support info and make a note of the Install Path, which will be something like:

/home/username/public_html/master/

To this, add feeds/ to derive the file system path of the feeds/ folder of your master installation, e.g.

/home/username/public_html/master/feeds/

...and use this as the value for $config_feedDirectory at line 4 inconfig.advanced.php, e.g:

  $config_feedDirectory = "/home/username/public_html/master/feeds/";

This approach means that you can use any feed in any installation, and the usual way to limit the import to only those categories required for any particular installation is a Drop Record If Not RegExp filter against the category field, using a value e.g.

(Category 1|Category 2|Category 3)

i.e. a pipe separated list of each category that is to be imported, all enclosed in brackets which makes a valid RegExp - make sure that there are no superfluous spaces at all.

When you come to setting up CRON, for the master installation use cron.php with the command derived for you via Setup > CRON e.g.

cd /home/username/public_html/master/scripts;/usr/bin/php cron.php

...and for all other installations just schedule import.php @ALL e.g.

cd /home/username/public_html/other/scripts;/usr/bin/php import.php @ALL

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by support on Mon, 2015-04-27 15:03.

Hi everyone,

I've created a top level "site search" script for searching multiple sub-directory installations and displaying the installation category name (linked to search.php in that installation) and result count. The script is available for download, and the code body can be preceded and followed with your home page header / footer content or used as required.

The code begins with a $sites array that needs to be populated with the list of sub-directory category installations to be included in the search, for example:

  $sites["Category 1"] = "installation-one/";
  $sites["Category 2"] = "installation-two/";

...where the array keys are the category name to be displayed, and the corresponding values the relative installation-folder name of that category installation, including the tailing "/".

Cheers,
David.
--
PriceTapestry.com