Hi,
Can anybody help? Is there a script available to produce a product feed compatible with Google Base? It needs to be in either text or xml format.
Any help would be much appreciated.
Regards
Hayden
Hi David,
Thanks, this script is exactly what I need, all except one thing, is it possible to change the buy url to the product url on my site?
This is the code I Used:
<?php
require("includes/common.php");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=products.csv");
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products`";
print "Merchant,Name,Description,ImageURL,BuyURL,Price,Category,Brand\n";
$link = mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword);
mysql_select_db($config_databaseName,$link);
$result = mysql_unbuffered_query($sql,$link);
while($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
print $row["merchant"].",";
print $row["name"].",";
print $row["description"].",";
print $row["image_url"].",";
print $row["buy_url"].",";
print $row["price"].",";
print $row["category"].",";
print $row["brand"]."\n";
}
?>
Regards
Hayden
Hi Hayden,
Sure - just replace this line:
print $row["buy_url"].",";
...with:
if ($config_useRewrite)
{
$row["buy_url"] = $config_baseHREF."product/".tapestry_hyphenate($row["name"]).".html";
}
else
{
$row["buy_url"] = $config_baseHREF."products.php?q=".urlencode($row["name"]);
}
print "http://www.example.com".$row["buy_url"].",";
...replacing www.example.com with your domain name (but not the path to Price Tapestry as this is included by $config_baseHREF...
Cheers,
David.
Hi Hayden,
Are you referring to exporting products from your Price Tapestry in Google Base format or are you referring in general to another database / system that you may have? If you want to export your Price Tapestry database, there is some discussion and code for doing this in the following thread:
http://www.pricetapestry.com/node/506
Cheers,
David.