Hi David
My plan was to have one PT install on my main domain (example.com), and use 'pricesExternal.php' to display prices in a blog on an add on domain (nicheexample.com). So far this has been really straightforward to achieve and is working well.
What I would like to do though is to ensure that the 'jump.php' url used in the add on domain refers to its own url (nicheexample.com/shopping/jump.php) rather than the main url (example.com/shopping/jump.php) so it doesn't look like the link is going to a different site. I don't want to use javascript for this, and I understand you can't mod_rewrite across domain names.
Apart from installing PT on the add on domain is there another solution? Perhaps even a cut down install with just the jump.php and supporting files in the add on domain?
Thanks
Hi Andy,
This can be done relatively easily with a slightly modified version of jump.php running in the root (/) directory of each of your niche sites, combined with a modification to the tapestry_buyURL() function in includes/tapestry.php.
Firstly, to make the new version of jump.php (which you will need to place in each of the top level folders of your niche sites), start with a fresh copy of jump.php and then look for the following code on line 2:
require("includes/common.php");
...and REPLACE this with:
$external_path = "/path/to/pricetapestry/";
require($external_path."config.php");
require($external_path."includes/database.php");
(where $external_path is identical to the $external_path that you are using within the PHP calling code in your external pages).
Then, within your Price Tapestry distribution, edit includes/tapestry.php and look for the following code beginning at line 51:
if ($config_useTracking)
{
return $config_baseHREF."jump.php?id=".$product["id"];
}
...and REPLACE this with:
if ($config_useTracking)
{
if (substr($config_baseHREF,0,4)=="http")
{
return "/jump.php?id=".$product["id"];
}
else
{
return $config_baseHREF."jump.php?id=".$product["id"];
}
}
This will mean that if a modified $config_baseHREF as used when being called via external.php, the path to jump.php is fixed at / (the top level directory), so this mod in conjuction with the the modified jump.php as described above should do the trick...
Cheers,
David.
That works a treat! Many thanks for your help on this.
Hi Andy,
This is certainly going to be possible without multiple full-installs - probably just a skeleton jump.php modified to include full paths to the includes, together with a modification to the function in includes/tapestry.php that generates the actual "Visit Store" link.
Bear with me and i'll work out the best solution first thing tomorrow for you...
Cheers,
David.