Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically send data feed to Froogle


gottaloveit

Recommended Posts

They have a contact form on the merchant page:

 

https://www.google.com/froogle/merchants/we...%2Fmerchants%2F

 

it's been pretty annoying, since i need to test the feeds especially since 1.51 is now in beta. it uploads the feed, is in the ftp, but doesn't pick it up nor register with froogle, then... it's just finally processed some from august.

 

speaking of 1.51 beta, does anyone else want to test it? so far, i haven't had any volunteers.

Edited by FlyingMonkey

Most likely your question has been answered, please do a search first.

Link to comment
Share on other sites

They have a contact form on the merchant page:

 

https://www.google.com/froogle/merchants/we...%2Fmerchants%2F

 

it's been pretty annoying, since i need to test the feeds especially since 1.51 is now in beta.  it uploads the feed, is in the ftp, but doesn't pick it up nor register with froogle, then... it's just finally processed some from august.

 

speaking of 1.51 beta, does anyone else want to test it?  so far, i haven't had any volunteers.

Sure, I'd be interested in getting a peek at the code.

 

I coded an Amazon and Yahoo feed for my client that does pretty much the same thing as your great contribution. The only difference is that I used classes so the code was reuseable...makes adding more feeds easier.

 

Mind if I get a peek at your admin 2.0 code? I'd like to see if the direction you are taking mirrors my own. Basically, I 'm going with classes and each feed extending. If you're going this way too maybe we can share notes.

feeds.gif

Edited by Chemo
Link to comment
Share on other sites

Is the Yahoo and Amazon code a contribution ??

 

The "[email protected]" email address I quoted earlier in this thread is not the correct one to contact the people for Froogle - it got bounced.

 

I know there is a contact page within the Merchant Center, but it's nice to track messages etc.

 

Does anyone know what the correct address is please ??

Edited by KeithDaley
Link to comment
Share on other sites

The code belongs to my client so I can't release it. However, if the developers of the Froogle contribution let me take a peek at the admin code I might be able to get those feeds ported for their code base.

Link to comment
Share on other sites

if you discuss items in the forum about code, how things work, etc with osCommerce, by forum rules the code is to be made available to the contribution section of the forum.

so if you dont want to release things then dont discuss them at all.

 

now for the feed to froogle, i had one published today by them (i checked and stated was published) so they have a screwy system.

 

i checked the path of the images with frooble, it could be they are limiting the # of bytes in the listing, so if a long name then the image would not show.

Link to comment
Share on other sites

As I said in my post, if the developers of the admin module for this Froogle contribution let's me take a peek at the code I'll PORT THE AMAZON FEED DIRECTLY. So, I can't release what I have coded for my client BUT I will port it over to work with the admin module.

Link to comment
Share on other sites

just stop discussing your code and then there is no problem with you having to post your code.

 

you are asking for code yet not wanting/willing to release your code.

Edited by Mibble
Link to comment
Share on other sites

Whether or not you have 4,500 posts or not you're totally off base. I am willing to share the code that I port over to THEIR ADMIN MODULE. I'm not talking about my code and you're the only one that is. I am talking about getting their dev code so I can get the Amazon, Yahoo, and Shopping.com classes ported. The devs have said their admin module is designed for multiple feeds. All I'm trying to do is give them 3 classes...

Link to comment
Share on other sites

??? The point is to make a modular feed section that supports not only Froogle but also other feeds (at least that's stated in their release). I can already integrate the Froogle admin...easy enough...but getting a modular system that CONFORMS TO OSCOMMERCE API and supports multiple feeds is the ultimate goal of all.

 

Enough of this...I'll wait until they release their feed module or release my own version.

Link to comment
Share on other sites

Well, Calvin,

 

The code looked like it worked in the .txt file, but Froogle still shows my items with no image.

 

Their solution was to do what you actually did, and put in %20 for spaces.

Apparently there is something else wrong, and I'm betting it's at Froogle, not in your script.

 

Thanks for all the help. If anyone has any ideas please let me know, thanks.

 

G

____________________________________

every day above ground is a good day.

Link to comment
Share on other sites

UPDATE:

 

Most, but not all of my images are beginning to show up.

There is definitely a lag at Froogle when it comes to images.

 

FMonkey (Calvin), thanks for this updated code, it appears to be a 95% fix.

 

I'm still tracking down why 5% of the images don't show up.

 

Thanks all.

____________________________________

every day above ground is a good day.

Link to comment
Share on other sites

MAJOR UPDATE:

 

It was my impatience. ALL images are now showing up at Froogle.

 

Calvin, thanks. Consider that code fix for "spaces within image files" to be golden.

 

You are da man, as always.

 

G

____________________________________

every day above ground is a good day.

Link to comment
Share on other sites

Froogle appears to be fixed at this time.

 

Any idea why my server logs are showing these error each time I run the Froogle cron? This goes on for perhaps 250 entries.

 

PHP Notice: Undefined index: 47 in /usr/home/mydir/public_html/store/admin/froogle.php on line 81

PHP Notice: Undefined index: 105 in /usr/home/mydir/public_html/store/admin/froogle.php on line 172

PHP Notice: Undefined variable: strip_replace in /usr/home/mydir/public_html/store/admin/froogle.php on line 191

PHP Notice: Undefined variable: strip_replace in /usr/home/mydir/public_html/store/admin/froogle.php on line 192

PHP Notice: Undefined index: 109 in /usr/home/mydir/public_html/store/admin/froogle.php on line 172

PHP Notice: Undefined variable: strip_replace in /usr/home/mydir/public_html/store/admin/froogle.php on line 191

PHP Notice: Undefined variable: strip_replace in /usr/home/mydir/public_html/store/admin/froogle.php on line 192

Link to comment
Share on other sites

Hi, sorry to jump in. I've managed to set up the feed and Froogle have sent an email to say that although the feed has uploaded, it needs changes making.

 

The prices uploaded in the feed differ from the prices displaying on our site. This is not acceptable to Froogle (obviously!) and is caused because the feed prices do not include VAT at 17.5%. Our site displays prices including VAT - we don't want to display prices without it.

 

How can I get the froogle.php file to write prices including VAT to the txt file? I know this subject was mentioned briefly towards the start of this thread (believe me, I've trawled all 53 pages trying to find an answer!), but my PHP experience is somewhat lacking :rolleyes: and I could really do with the help of someone who knows what they're talking about or may have solved this themselves to talk me through it...

 

I'm suprised that no-one else has picked this up, or are we the only store only displaying prices inclusive of tax?

 

Please help!!!

Link to comment
Share on other sites

??? The point is to make a modular feed section that supports not only Froogle but also other feeds (at least that's stated in their release). I can already integrate the Froogle admin...easy enough...but getting a modular system that CONFORMS TO OSCOMMERCE API and supports multiple feeds is the ultimate goal of all.

 

Enough of this...I'll wait until they release their feed module or release my own version.

I released my Live Data Feed base class + Froogle (adminCP integrated) and can be downloaded here: Live Data Feed base class + Froogle

 

Announcement for this contribution is here: Announcement

 

Support for this contribution is here: Support thread

 

Features:

1. Admin control panel integration

2. Automatic image enlargement (even enlarge GIFs!)

3. FTP upload, HTTP download, view HTML, view TEXT

4. Base class can be extended for most ANY OTHER FEED SERVICE so is modular

5. Easy to install. 1 file change (column_left.php to get it on the menu) and all are new files (nothing to overwrite or backup).

6. Server friendly. Only uses 1 query to generate the data.

 

Screen shots are included in the contribution. Testers needed for development of additional modules (Amazon, Yahoo, Shopping.com, etc.)

Link to comment
Share on other sites

Hi, sorry to jump in. I've managed to set up the feed and Froogle have sent an email to say that although the feed has uploaded, it needs changes making.

 

The prices uploaded in the feed differ from the prices displaying on our site. This is not acceptable to Froogle (obviously!) and is caused because the feed prices do not include VAT at 17.5%. Our site displays prices including VAT - we don't want to display prices without it.

 

How can I get the froogle.php file to write prices including VAT to the txt file? I know this subject was mentioned briefly towards the start of this thread (believe me, I've trawled all 53 pages trying to find an answer!), but my PHP experience is somewhat lacking :rolleyes: and I could really do with the help of someone who knows what they're talking about or may have solved this themselves to talk me through it...

 

I'm suprised that no-one else has picked this up, or are we the only store only displaying prices inclusive of tax?

 

Please help!!!

The simpliest way is to:

 

Find:

  $output .= $row->product_url . "\t" .
 preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->name) ) ) . "\t" .
 preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->description) ) ) . "\t" .
 $row->price . "\t" .
 $row->image_url . "\t" .
 $catIndex[$row->prodCatID] . "\t" .
 $row->id;

 

replace with:

 

$vat = 1.175; //where 17.5% is your tax rate

$row->price = $row->price * vat;

$output .= $row->product_url . "\t" .

preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->name) ) ) . "\t" .

preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->description) ) ) . "\t" .

$row->price . "\t" .

$row->image_url . "\t" .

$catIndex[$row->prodCatID] . "\t" .

$row->id;

Most likely your question has been answered, please do a search first.

Link to comment
Share on other sites

They have a contact form on the merchant page:

 

https://www.google.com/froogle/merchants/we...%2Fmerchants%2F

 

it's been pretty annoying, since i need to test the feeds especially since 1.51 is now in beta.? it uploads the feed, is in the ftp, but doesn't pick it up nor register with froogle, then... it's just finally processed some from august.

 

speaking of 1.51 beta, does anyone else want to test it?? so far, i haven't had any volunteers.

Sure, I'd be interested in getting a peek at the code.

 

I coded an Amazon and Yahoo feed for my client that does pretty much the same thing as your great contribution. The only difference is that I used classes so the code was reuseable...makes adding more feeds easier.

 

Mind if I get a peek at your admin 2.0 code? I'd like to see if the direction you are taking mirrors my own. Basically, I 'm going with classes and each feed extending. If you're going this way too maybe we can share notes.

The admin panel consist of an added box to the left_column.php that adds links to each of the feeds. Modulization is planned for the following release after 1.51 and upgrades to the admin console. It should make it fairly easy to write a feeder for any service and upgrade the core code. I noticed you released your own feeder, did you still want to see the admin code? It's just a simple box with a page with links (for now).

Most likely your question has been answered, please do a search first.

Link to comment
Share on other sites

The admin panel consist of an added box to the left_column.php that adds links to each of the feeds. Modulization is planned for the following release after 1.51 and upgrades to the admin console. It should make it fairly easy to write a feeder for any service and upgrade the core code. I noticed you released your own feeder, did you still want to see the admin code? It's just a simple box with a page with links (for now).

Take a look at my base class...it has the basic methods needed for a feed: upload, download, viewHTML, viewTXT, and automatic image enlargement (for those that require 500px images). The actual query used (makedata() method) is defined in each inhereted class so is modular. Also, each new feed that is derived from the base class can be coded quickly and efficiently. If a derived class has some useful methods just modify the base class so ALL feeds can use it.

 

I have the Froogle derived class included so you can see it does not have any other fields other than the basics but demonstrates how easy it is to code more classes.

 

Give me some feedback...

Link to comment
Share on other sites

The simpliest way is to:

 

Find:

 ?$output .= $row->product_url . "\t" .
?preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->name) ) ) . "\t" .
?preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->description) ) ) . "\t" .
?$row->price . "\t" .
?$row->image_url . "\t" .
?$catIndex[$row->prodCatID] . "\t" .
?$row->id;

 

replace with:

 

$vat = 1.175; //where 17.5% is your tax rate

$row->price = $row->price * vat;

$output .= $row->product_url . "\t" .

preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->name) ) ) . "\t" .

preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->description) ) ) . "\t" .

$row->price . "\t" .

$row->image_url . "\t" .

$catIndex[$row->prodCatID] . "\t" .

$row->id;

Thanks, I'll give it a go!

Link to comment
Share on other sites

OK, I tried amending the code. The file runs and creates the txt file fine, other than the price, which is now displaying as 0, instead of adding the VAT. Would you mind having a look for me?

 

I've deliberately deleted the usernames etc. at the top of the file.

 

Many thanks in advance!

 

$convertCur = false; //default = false
$curType = "GBP"; // Converts Currency to any defined currency (eg. USD, EUR, GBP)
if($convertCur)
{
$productURL = 'http://www.droolonline.co.uk/product_info.php?currency=GBP&products_id=';  //where CURTYPE is your currency type (eg. USD, EUR, GBP)
}

//START Advance Optional Values

//(0=False 1=True) (optional_sec must be enabled to use any options)
$optional_sec = 1;
$instock = 0;
$shipping = 0;
$lowestShipping = "4.95";  //this is not binary.
$brand = 0;
$upc = 0;   //Not supported by default osC
$manufacturer_id = 0;  //Not supported by default osC
$product_type = 0;
$currency = 0;
$default_currency = "GBP";  //this is not binary.
$language = 0;
$default_language = "en";  //this is not binary.
$ship_to = 0;
$default_ship_to = "ALL"; //this is not binary, not supported by default osC for individual products.
$ship_from = 0;
$default_ship_from = "USD"; //this is not binary, not supported by default osC for individual products.

//END of Advance Optional Values

if (!($link=mysql_connect($home,$user,$pass)))
{
echo "Error when connecting itself to the data base";
exit();
}
if (!mysql_select_db( $base , $link ))
{
echo "Error the data base does not exist";
exit();
}

$sql = "
SELECT concat( '" . $productURL . "' ,products.products_id) AS product_url,
products_model AS prodModel, products_weight,
manufacturers.manufacturers_name AS mfgName,
manufacturers.manufacturers_id,
products.products_id AS id,
products_description.products_name AS name,
products_description.products_description AS description,
products.products_status AS prodStatus,
FORMAT(products.products_price,2) AS price,
CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url,
products_to_categories.categories_id AS prodCatID,
categories.parent_id AS catParentID,
categories_description.categories_name AS catName
FROM categories,
categories_description,
products,
products_description,
products_to_categories

left join manufacturers on ( manufacturers.manufacturers_id = products.manufacturers_id )

WHERE products.products_id=products_description.products_id
AND products.products_id=products_to_categories.products_id
AND products_to_categories.categories_id=categories.categories_id
AND categories.categories_id=categories_description.categories_id
ORDER BY
products.products_id ASC
";


$catInfo = "
SELECT
categories.categories_id AS curCatID,
categories.parent_id AS parentCatID,
categories_description.categories_name AS catName
FROM
categories,
categories_description
WHERE categories.categories_id = categories_description.categories_id
";

function findCat($curID, $catTempPar, $catTempDes, $catIndex)
{
if($catTempPar[$curID] != 0 )
{
 if($catIndex[$catTempPar[$curID]] != null)
 {
	 $temp=$catIndex[$catTempPar[$curID]];
 }
 else
 {
	 $catIndex = findCat($catTempPar[$curID], $catTempPar, $catTempDes, $catIndex);
	 $temp = $catIndex[$catTempPar[$curID]];
 }
}
if($catTempPar[$curID] == 0)
{
 $catIndex[$curID] = $catTempDes[$curID];
}
else
{
 $catIndex[$curID] = $temp . " > " . $catTempDes[$curID];
}
return $catIndex;

}

$catIndex = array();
$catTempDes = array();
$catTempPar = array();
$processCat = mysql_query( $catInfo )or die( $FunctionName . ": SQL error " . mysql_error() . "| catInfo = " . htmlentities($catInfo) );
while ( $catRow = mysql_fetch_object( $processCat ) )
{
$catKey = $catRow->curCatID;
$catName = $catRow->catName;
$catParID = $catRow->parentCatID;
if($catName != "")
{
 $catTempDes[$catKey]=$catName;
 $catTempPar[$catKey]=$catParID;
}
}

foreach($catTempDes as $curID=>$des)  //don't need the $des
{
$catIndex = findCat($curID, $catTempPar, $catTempDes, $catIndex);
}

//Check for any applicable specials for the corresponding products_id
$sql2 = "
SELECT
specials.products_id AS idS,
FORMAT(specials.specials_new_products_price,2) AS priceS
FROM
specials,
products
WHERE
specials.products_id=products.products_id
AND specials.status != 0
AND products.products_status != 0
ORDER BY
specials.products_id ASC
";

$_strip_search = array(
"![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars
'%[\r\n]+%m'); // remove CRs and newlines
$_strip_replace = array(
'',
'');

$output = "product_url \t name \t description \t price \t image_url \t category \t offer_id";

//create optional section
if($optional_sec == 1)
{
if($instock == 1)
 $output .= "\t instock ";
if($shipping == 1)
 $output .= "\t shipping ";
if($brand == 1)
 $output .= "\t brand ";
if($upc == 1)
 $output .= "\t upc ";
if($manufacturer_id == 1)
 $output .= "\t manufacturer_id ";
if($product_type == 1)
 $output .= "\t product_type ";
if($currency == 1)
 $output .= "\t currency ";
if($language == 1)
 $output .= "\t language ";
if($ship_to == 1)
 $output .= "\t ship_to ";
if($ship_from == 1)
 $output .= "\t ship_from ";
}
$output .= "\n";


$result=mysql_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) );

//Specials Checker
$result2=mysql_query( $sql2 )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql2 = " . htmlentities($sql2) );
$row2 = mysql_fetch_object( $result2 );

//Currency Information
if($convertCur)
{
$sql3 = "
SELECT
currencies.value AS curUSD
FROM
currencies
WHERE currencies.code = '$curType'
";

$result3=mysql_query( $sql3 )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql3 = " . htmlentities($sql3) );
$row3 = mysql_fetch_object( $result3 );
}

while( $row = mysql_fetch_object( $result ) )
{
if ($already_sent[$row->id] == 1) continue; // if we've sent this one, skip the rest of the while loop

if( $row->prodStatus == 1 || ($optional_sec == 1 && $instock == 1) )
{
 // reset the products price to our special price if there is one for this product
 if( $row2->idS == $row->id ){
	 $row->price = $row2->priceS;
	 $previdS = $row2->idS;
	 while ( $row2->idS == $previdS )
	 {
	 $row2 = mysql_fetch_object( $result2 );  //advance row in special's table
	 }
 }

 if($convertCur)
 {
	 $row->price = $row->price *  $row3->curUSD;
	 $row->price = number_format($row->price, 2, '.', '');
 }
$vat = 1.175; //where 17.5% is your tax rate
$row->price = $row->price * vat;
$output .= $row->product_url . "\t" .
preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->name) ) ) . "\t" .
preg_replace($_strip_search, $_strip_replace, strip_tags( str_replace(">", "> ", $row->description) ) ) . "\t" .
$row->price . "\t" .
$row->image_url . "\t" .
$catIndex[$row->prodCatID] . "\t" .
$row->id; 
//optional values section
if($optional_sec == 1)
{
 if($instock == 1)
 {
	 if($row->prodStatus == 1)
	 {
   $prodStatusOut = "Y";
	 }
	 else
	 {
   $prodStatusOut = "N";
	 }
	 $output .= " \t " . $prodStatusOut;
 }
 if($shipping == 1)
	 $output .= " \t " . $lowestShipping;
 if($brand == 1)
	 $output .= " \t " . $row->mfgName;
 if($upc == 1)
	 $output .= " \t " . "Not Supported";
 if($manufacturer_id == 1)
	 $output .= " \t " . "Not Supported";
 if($product_type == 1)
 {
	 $catNameTemp = strtolower($catName);
	 if($catNameTemp == "books")
   $productTypeOut = "book";
	 else if($catNameTemp == "music")
   $productTypeOut = "music";
	 else if($catNameTemp == "videos")
   $productTypeOut = "video";
	 else
   $productTypeOut = "other";

	 $output .= " \t " . $productTypeOut;
 }
 if($currency == 1)
	 $output .= " \t " . $default_currency;
 if($language == 1)
	 $output .= " \t " . $default_language;
 if($ship_to == 1)
	 $output .= " \t " . $default_ship_to;
 if($ship_from == 1)
	 $output .= " \t " . $default_ship_from;
}
$output .= " \n";
}
$already_sent[$row->id] = 1;
}

if ( file_exists( $OutFile ) )
unlink( $OutFile );

$fp = fopen( $OutFile , "w" );
$fout = fwrite( $fp , $output );
fclose( $fp );

/*
//Start FTP to Froogle

function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile )
{
// set up basic connection
$conn_id = ftp_connect($ftpservername);
if ( $conn_id == false )
{
echo "FTP open connection failed to $ftpservername <BR>\n";
return false;
}

// login with username and password
$login_result = ftp_login($conn_id, $ftpusername, $ftppassword);

// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!<BR>\n";
echo "Attempted to connect to " . $ftpservername . " for user " . $ftpusername . "<BR>\n";
return false;
} else {
echo "Connected to " . $ftpservername . ", for user " . $ftpusername . "<BR>\n";
}

if ( strlen( $ftpdirectory ) > 0 )
{
if (ftp_chdir($conn_id, $ftpdirectory )) {
echo "Current directory is now: " . ftp_pwd($conn_id) . "<BR>\n";
} else {
echo "Couldn't change directory on $ftpservername<BR>\n";
return false;
}
}

ftp_pasv ( $conn_id, true );
// upload the file
$upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII );

// check upload status
if (!$upload) {
echo "$ftpservername: FTP upload has failed!<BR>\n";
return false;
} else {
echo "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile . "<BR>\n";
}

// close the FTP stream
ftp_close($conn_id);

return true;
}

ftp_file( $ftp_server, $ftp_user_name, $ftp_user_pass, $source_file, $ftp_directory, $destination_file);

//End FTP to Froogle
*/

//  End TIMER
//  ---------
$etimer = explode( ' ', microtime() );
$etimer = $etimer[1] + $etimer[0];
echo '<p style="margin:auto; text-align:center">';
printf( "Script timer: <b>%f</b> seconds.", ($etimer-$stimer) );
echo '</p>';
//  ---------

?>

Link to comment
Share on other sites

just for grins, while i was reviewing error logs for one of my sites, i came across this:

 

$_strip_replace

 

then, other errors:

 

undefined index line 172

if ($already_sent[$row->id] == 1) continue; // if we've sent this one, skip the rest of the while loop

 

undefined varialble line 191/192

preg_replace($_strip_search, $strip_replace, strip_tags( str_replace(">", "> ", $row->name) ) ) . "\t" .

preg_replace($_strip_search, $strip_replace, strip_tags( str_replace(">", "> ", $row->description) ) ) . "\t" .

 

the txt file is created, which didnt push me to take a look at the error logs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...