You are here:  » Froogle file

Support Forum



Froogle file

Submitted by chiquita on Wed, 2007-08-01 22:47 in

Hello:
How can I generate the products.csv file with landing pages (buy url) on my domain instead of merchant landing pages?

Right now is generating landing urls:
http://www.merchant-site.com/gateway.asp?REF=QCM1131663

and I want the BuyUrl to be:
http://www.mysite.com/product/product-name.html

Thanks,

Submitted by support on Thu, 2007-08-02 06:49

Hello Chiquita,

The script in the following thread will generate the landing page you want:
http://www.pricetapestry.com/node/1252

If you're not using the script in that thread (I assume that you're not because as you say your's is printing the buy_url), can you post the code that you are using and I'll show you how to modify it to use the local page instead of buy_url...

Cheers,
David.

Submitted by chiquita on Thu, 2007-08-02 18:08

David:
Thanks for the reply.

I am using the code I found on this board and added a new file called products.php. So can you tell me exactly what I am supposed to do with the code from http://www.pricetapestry.com/node/1252

Submitted by support on Thu, 2007-08-02 18:13

Hi,

I'm not quite sure what you're currently using to generate your Froogle file, as the script in the other thread already uses the URL on your site, not the merchant URL. Can you post the script you are using and i'll show you how to change it to use the URL on your site. Alternatively you can email it to me if you like - reply to your reg code or forum registration email is the easiest way to get me...

Cheers,
David.

Submitted by chiquita on Thu, 2007-08-02 18:16

{code saved}

Submitted by chiquita on Thu, 2007-08-02 18:17

here is the code for the export file:

<?php
  set_time_limit
(0);
  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";
  if (
database_querySelect($sql,$rows))
  {
    foreach(
$rows as $row)
    {
      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";
    }
  }
?>

Submitted by support on Thu, 2007-08-02 18:22

Hi,

That makes sense now! Here's the changes to your export file to make it use the product URL on your site instead of the merchant URL:

<?php
  set_time_limit
(0);
  require(
"includes/common.php");
  
header("Content-Type: application/octet-stream");
  
header("Content-Disposition: attachment; filename=products.csv");
  
$baseUrl "http://".$_SERVER["HTTP_HOST"].$config_baseHREF;
  
$sql "SELECT * FROM `".$config_databaseTablePrefix."products`";
  print 
"Merchant,Name,Description,ImageURL,BuyURL,Price,Category,Brand\n";
  if (
database_querySelect($sql,$rows))
  {
    foreach(
$rows as $row)
    {
      if (
$config_useRewrite)
      {
        
$url $baseUrl."product/".urlencode(str_replace(" ","-",$row["name"])).".html";
      }
      else
      {
        
$url $baseUrl."products.php?q=".urlencode($row["name"]);
      }
      print 
$row["merchant"].",";
      print 
$row["name"].",";
      print 
$row["description"].",";
      print 
$row["image_url"].",";
      print 
$url.",";
      print 
$row["price"].",";
      print 
$row["category"].",";
      print 
$row["brand"]."\n";
    }
  }
?>

Hope this helps!
Cheers,
David.

Submitted by chiquita on Thu, 2007-08-02 20:24

David:
I ran this export.php and returned an empty file :(

Submitted by support on Thu, 2007-08-02 20:29

Hiya,

The changes shouldn't make any difference at all to the output. Can you roll back to the old version and see if that returns any products; and if so - re-apply the changes and try again...

Cheers,
David.

Submitted by chiquita on Thu, 2007-08-02 20:35

I rolled back to the original export.php contents and still is returning an empty file.

Submitted by support on Thu, 2007-08-02 20:38

Hi,

Have you had this script working before? If so, have there been any changes that you might have made in the mean time?

Submitted by chiquita on Thu, 2007-08-02 20:49

the export file was working fine before I apply those changes and is the same code that I posted earlier.

Submitted by support on Thu, 2007-08-02 20:57

Hi chiquita,

Can you please email me your current export.php and I will incorporate the changes for you and send it back to you... reply to your reg code or forum registration email is the easiest way to get me. Please make sure to sent it as an attachment rather than just copy and pasted - and make sure of course that it is the version that is working before sending it...!

Cheers,
David.

Submitted by chiquita on Thu, 2007-08-02 21:01

email sent :)

thanks much for your help

Submitted by mally on Mon, 2007-08-13 15:57

I've tried implenting this but I'm having no joy.

I created a file called froogle and copied the baove code.

the problem is froogle is looking for the following file build up in order

"title" "description" "image_link" "link" "price"

can this be implemented from the above code?

thanks

Mally

Submitted by support on Mon, 2007-08-13 16:05

Hi Mally,

If you just need a different layout that can be done quite easily. Does froogle require quote delimited values, with the line you provided as a header row? And are they comma separated? If so, the following script should do this:

<?php
  set_time_limit
(0);
  require(
"includes/common.php");
  
header("Content-Type: application/octet-stream");
  
header("Content-Disposition: attachment; filename=products.csv");
  
$baseUrl "http://".$_SERVER["HTTP_HOST"].$config_baseHREF;
  
$sql "SELECT * FROM `".$config_databaseTablePrefix."products`";
  print 
'"title","description","image_link","link","price"';
  if (
database_querySelect($sql,$rows))
  {
    foreach(
$rows as $row)
    {
      if (
$config_useRewrite)
      {
        
$url $baseUrl."product/".urlencode(str_replace(" ","-",$row["name"])).".html";
      }
      else
      {
        
$url $baseUrl."products.php?q=".urlencode($row["name"]);
      }
      print 
'"'.$row["name"].'",';
      print 
'"'.$row["description"].'",';
      print 
'"'.$row["image_url"].'",';
      print 
'"'.$url.'",';
      print 
'"'.$row["price"].'"\n';
    }
  }
?>

Hope this helps,
Cheers,
David.

Submitted by mally on Mon, 2007-08-13 22:03

I've checked http://base.google.com/base/products.txt and it appears to be without "" and tab delimited (if that makes any sense

Submitted by mally on Mon, 2007-08-13 22:09

I just checked my inbox and found the following email from google telling me the layout required

QUOTE! It looks like you've sent us a text file in a format that Google Base does not support. Our system is currently able to accommodate only tab-delimited text files. Your tab-delimited file should have one tab separating each attribute from the next and should not include any tabs after the last attribute on any given line. An example tab-delimited header line would be:

link(tab)title(tab)description(tab)price(tab)image_link(tab)product_type

For more detailed tab-delimited bulk upload instructions, please visit the link below:

http://base.google.com/support/bin/answer.py?answer=58083&hlrm=en

Please resubmit your bulk upload after you've saved it in the tab-delimited format. We'll notify you if we need you to make any additional corrections. Otherwise, we'll send you an email to let you know that your bulk upload has been approved

Submitted by support on Mon, 2007-08-13 22:12

Hi,

Is "product_type" mandatory? If so, do you know what it should contain in this instance?

Cheers,
David.

Submitted by mally on Tue, 2007-08-14 18:05

umm, product type in my case would be magazine

Submitted by support on Wed, 2007-08-15 08:28

Hi Mally,

Based on the format specification above, try this:

<?php
  set_time_limit
(0);
  require(
"includes/common.php");
  
header("Content-Type: application/octet-stream");
  
header("Content-Disposition: attachment; filename=products.csv");
  
$baseUrl "http://".$_SERVER["HTTP_HOST"].$config_baseHREF;
  
$sql "SELECT * FROM `".$config_databaseTablePrefix."products`";
  print 
"link\ttitle\tdescription\tprice\timage_link\tproduct_type\n";
  if (
database_querySelect($sql,$rows))
  {
    foreach(
$rows as $row)
    {
      if (
$config_useRewrite)
      {
        
$url $baseUrl."product/".urlencode(str_replace(" ","-",$row["name"])).".html";
      }
      else
      {
        
$url $baseUrl."products.php?q=".urlencode($row["name"]);
      }
      print 
$url."\t";
      print 
$row["name"]."\t";
      print 
$row["description"]."\t";
      print 
$row["price"]."\t";
      print 
$row["image_url"]."\t";
      print 
"Magazine"."\n";
    }
  }
?>

Cheers,
David.

Submitted by mally on Wed, 2007-08-15 21:44

just checked and its worked and shown as processing

thanks David!

Mally

Submitted by clare on Tue, 2007-09-11 09:48

Could this script be modified to show only products from one merchant instead of all products?

Submitted by support on Tue, 2007-09-11 10:10

Hi Clare,

Sure - on the line that generates the SQL...

  $sql = "SELECT * FROM `".$config_databaseTablePrefix."products`";

...simply change this as follows:

  $sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE merchant='Merchant Name'";

(replacing Merchant Name with the merchant you wish to use)

Cheers,
David.

Submitted by clare on Tue, 2007-09-11 10:28

Great, thanks again