Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically send data feed to Froogle


gottaloveit

Recommended Posts

Thanks for the quick reply. I will anxiously await the attribute pricing fix. :)

As far as descriptions go, every page says exactly what the item is. The only thing I sell is tapestry products. And how they can get some of the categories I've seen is absolutely beyond me. Maybe a dart board. lol

Why are so many people worried about category depth when Froogle won't even use the categories to start with? Just curious...

 

Thanks,

Laurie

Some people have stores with thousands of products with hundreds of categories. The category strings for some of these are amazing. The more category information than can be given to Froogle, the easier it is for them to categorize. Also, I believe some of them got error e-mails from Froogle because it didn't include the full category trees. One of my client sells niche products and only has a category depth of one. At times their products are shown as medical supplies on Froogle and they're selling glass art.

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

Link to comment
Share on other sites

LOL They ARE using a dart board. :rolleyes:

Maybe the category depth is part of the problem then as mine are only 1 deep. Thank you for the insight!

 

Laurie

Thanks for the Donation Laurie! It was very much appreciated.

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

Link to comment
Share on other sites

Calvin,

You are most welcome. I am trying to work my way around to all of the people who've developed what I'm using. Slowly, but surely. :) Maybe if more osC users did, we'd have an even better system. Free is cool, but giving back is better. :D

 

Thank you again for all of your efforts.

Laurie

 

"Man is a magnet, and every line and dot and detail of his experiences come by his own attraction." - Elizabeth Towne

Link to comment
Share on other sites

Hi I just installed the contribution on my server. I finally got everyt hing to work and it says it is uploading to google but at the end i get this error:

<br>

<b>Parse error</b>: parse error in <b>/home/healthy/htdocs/admin/froogle.php</b> on line <b>156</b><br>

 

one of these lines seem to be the prob, but i did not change anything other than removing the */ /*. They are at the line the error was reported

 

//close the FTP stream

ftp_close($conn_id);

 

Any help is appriciated.

Edited by dsm1217
Link to comment
Share on other sites

thats what i though the first itme so i started over, the only things i removed were the comments that were around ftp part. Here is the code, maybe someone will notice somthing I am missing:

 

<?php

 

$OutFile = "/home/healthy/htdocs/admin/temp/froogle/hlpfroogle.txt"; //"CHANGEME-full-path-to-file-with-777-dir-and-file-permissions.fr-outfile.txt";

 

$destination_file = "hlpfroogle.txt"; //"CHANGEME-filename-to-upload-to-froogle.txt" ;

 

$source_file = $OutFile;

 

$imageURL = 'http://www.healthylifepharmacy.com/images';

 

$productURL = 'http://www.healthylifepharmacy.com/product_info.php?products_id=';

 

$already_sent = array();

 

 

 

$home = "localhost" ;

 

$user="removed";

 

$pass="removed";

 

$base="shop";

 

 

 

$ftp_server = "hedwig.google.com" ;

 

$ftp_user_name = "removed";

 

$ftp_user_pass = "removed";

 

 

 

 

 

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 , products_weight ,

 

manufacturers.manufacturers_name ,

 

products.products_id AS id,

 

products_description.products_name AS name,

 

products_description.products_description AS description,

 

FORMAT(products.products_price,2) AS price,

 

CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url,

 

concat_ws( ' > ' , catdescparent.categories_name , catdesccurrent.categories_name ) AS category

 

FROM categories ,

 

products,

 

products_description,

 

categories_description as catdesccurrent,

 

products_to_categories

 

 

 

 

 

left join categories_description as catdescparent on ( catdescparent.categories_id = categories.parent_id )

 

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 catdesccurrent.categories_id = categories.categories_id

 

AND products.products_status != 0

 

ORDER BY

 

products.products_id ASC

 

";

 

 

 

 

 

//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\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 );

 

 

 

$i = 0;

 

while( $row = mysql_fetch_object( $result ) )

 

{

 

if( $i == 1 ) //first time init

 

{

 

$already_sent[$row->name] = 1;

 

}

 

$i++;

 

 

 

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

 

 

 

// 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

 

}

 

}

 

 

 

$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->name) ) ) . "\t" .

 

$row->price . "\t" .

 

$row->image_url . "\t" .

 

$row->category . "\n";

 

 

 

$already_sent[$row->name] = 1;

 

}

 

 

 

if ( file_exists( $OutFile ) )

 

unlink( $OutFile );

 

 

 

$fp = fopen( $OutFile , "w" );

 

$fout = fwrite( $fp , $output );

 

fclose( $fp );

 

 

 

//Start FTP to Froogle

 

 

 

// set up basic connection

 

$conn_id = ftp_connect($ftp_server);

 

 

 

// login with username and password

 

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

 

 

 

// check connection

 

if ((!$conn_id) || (!$login_result)) {

 

echo "FTP connection has failed!<BR>";

 

echo "Attempted to connect to $ftp_server for user $ftp_user_name<BR>";

 

exit;

 

} else {

 

echo "Connected to $ftp_server, for user $ftp_user_name<BR>";

 

}

 

 

 

// upload the file

 

$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);

 

 

 

// check upload status

 

if (!$upload) {

 

echo "FTP upload has <b>FAILED!</b> source: $source_file dest: $destination_file<BR>";

 

} else {

 

echo "Uploaded $source_file to $ftp_server as $destination_file<BR>";

 

}

 

 

 

//close the FTP stream

 

ftp_close($conn_id);

 

 

 

//End FTP to Froogle

 

?>

 

 

 

NOTE the removed password are correct on my rserver. Help is appriciated. Thanks all

Edited by dsm1217
Link to comment
Share on other sites

sorry, yes it is being created and placed where it should be. it also appears to be correct in formatting

heh? then what's wrong? if your still getting the parsing error, try deleting the generated file in that directory. then rerunning it and see if the file still exist. if the file is not there, then just copy and paste your settings into a fresh froogle.php and uncomment the ftp code.

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

Link to comment
Share on other sites

well it would not upload to froogle was the problem at the time. i am getting a different error now for some reason. I have not changed anything in the script. Here is what it says now:

 

Output from command /usr/bin/php -q /home/healthy/htdocs/admin/froogle.php ..

 

<br>

<b>Warning</b>: Unable to find ftpbuf 0 in <b>/home/healthy/htdocs/admin/froogle.php</b> on line <b>135</b><br>

FTP connection has failed!<BR>Attempted to connect to hedwig.google.com for user healthylifepharmacy<BR>

 

sorry forgot to add that the froogle.txt file is still getting built, the problems arise in the ftp portion of the task

Edited by dsm1217
Link to comment
Share on other sites

dsm1217

 

One thing to check is if your froogle feed is being written to a password protected directory (i.e., somewhere under admin/), then when you are uploading the file, it may not have permissions to read the file.

 

You initial problem was likely just a read permissions problem. I don't know what your problem is now, but if you get back to where you were, try writing the file to an open directory and see if it works. You can add a function to delete the file after the upload if you are concerned about it.

 

Dan

Dan Stevens

Link to comment
Share on other sites

make sure you can write the data file to the directory pointed to, it does work pretty good. i havent played with it on iis6, do you have iis6 working all the way now? there were a few problems a long time ago with it.

Link to comment
Share on other sites

211655,

 

Windows servers (and workstations) have AT. It works similar to cron. I haven't use it for some time but it is capable of running allmost any job at any time on just about any schedule you might want. Do a google on "at commands" and you should be able to find all you need to get it going.

 

Good Luck.

CatDadRick

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...