Hi David,
I just bought PT today and I am looking forward to using it! I have heard a lot of great things about it so thought I would check it out to see if it's what I am looking for.
I have had a quick look at the source code of PT and it's clearly written and easy to understand, great! But there's a few things I can't get my head around.
I was hoping to use PT kind of like an API to the datafeed information for the retailers products, I am looking to know if you could tell me that these features I am looking for are possible with PT, I have yet to install PT on my wordpress website as I don't know where the best place to install it would be, therefore I haven't had a chance to look at the generated tables and experiment with the datafeeds yet.
Could you advise me on where the best place to install PT would be on an existing WP installation?
Also, what links all of the products uniquely together that allows PT to compare the prices across multiple retailers? Is it a product code of some sort? A table that contains all of the unique codes that interlink all of the products among the retailers? The reason I ask is, when I upload the necessary datafeeds, I want to be able to run a script that will generate new WP posts for each unique product and with that WP post I want to store the unique identifier in a custom field value, that way when the product page is loaded I have the unique identifier to query whatever MYSQL table/tables I need to do a price comparison on that given product, I am sure what tables I need to query will become clear when I install PT.
All I need PT for is to manage the datafeeds for the products and to allow me to easily query to get the information I need which I can do when the posts contain the unique identifiers, I will then build a WP Theme around these different database queries pulling out what I need on specific pages/posts etc.
Is this all possible with PT?
I know it's a bit long winded and I really appreciate your time, I am just looking forward to using PT to it's full potential and get cracking on with this project!
Cheers,
Chris
David,
You are a legend! Seems PT does everything I am looking for and with a detailed response like that I should have it up and running in no time :)!
Thanks again!
Chris
Hi Chris,
Thank you for your comments!
First thing first; re:
> Could you advise me on where the best place to install
> PT would be on an existing WP installation?
As you're only planning to use Price Tapestry to drive external content rather than having users visit the Price Tapestry installation; it's best to install it into a sub-directory so that it doesn't interfere with WordPress file - anything will do really - for example /comparison/
When installing into a sub-directory; don't forget to set in config.php:
$config_baseHREF = "/comparison/";
(or whatever directory name you choose)
As users won't be visiting the site directory; there's probably no need to use clean URLs ($config_useRewrite); and what I guess you'll ultimately end up with is the Buy URLs for each product directly embedded within your WordPress page.
> Also, what links all of the products uniquely together
> that allows PT to compare the prices across multiple
> retailers? Is it a product code of some sort?
It's actually entirely based on product name - as very few affiliate datafeeds actually have unique ID (SKU, EAN etc.) fields. To aid comparison, the script includes the Product Mapping featured; which enables you to link the same product but with slightly different names from different merchants together, so that they are all imported with the same product name. This featured is "dynamic", in that you can supply as little a single keyword (e.g. a model number) to link products together.
As such, and given that the name field is indexed; I would actually recommend linking your dynamic code by product name. I'm assuming that as you're intending to create pages per product that you are looking at a niche area; in which case there shouldn't be any database overhead problem at all linking in this way.
Whenever you update the Price Tapestry database; you can simply run a process that SELECTs DISTINCT(name) FROM `products`, and then looping through the results a) check whether a WordPress page with that title (I presume you will be using product name as page title) exists; and either create the new post if necessary or update an existing one.
Regarding the price comparison table within the newly created WordPress page; I would actually recommend using the existing "external" scripts; which have been updated for the latest distribution of Price Tapestry, and can be found in this post:
http://www.pricetapestry.com/node/2289#comment-12980
In your case, as your script dynamically generates your WordPress pages; at the same time it can dynamically generate to the code to call pricesExternal.php for the given product name:
<?php
$common_baseHREF = "http://www.example.com/comparison/";
$common_path = "/path/to/comparison/";
$_GET["q"] = "Product Name";
require($common_path."pricesExternal.php");
?>
That way, whenever the WordPress page for "Product Name" is viewed; live prices for that product will be pulled from the Price Tapestry database. To work out the value you need for $common_path on your server, go to "Support Info" from your /comparison/admin/ page.
Hopefully that covers it! The main issue that is encountered using the external scripts is a conflict between WordPress and Price Tapestry database connections. If this happens, you can edit includes/database.php and add TRUE to each call to mysql_connect, for example:
$link = @mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword,TRUE);
...which normally resolves any conflicts.
Hope this points you in the right direction!
Cheers,
David.