Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically send data feed to Froogle


gottaloveit

Recommended Posts

When we install the froogle uploader and we set it up it give us this error

 

File completed: dutchpipeltd.txt

 

Fatal error: Call to undefined function: ftp_connect() in /usr/www/users/marvinlb/catalog/admin/froogle.php on line 313

It creates the file but does not upload it to froogle.

We have uncommented the ftp block but we still get this error.

 

Thank you,

 

 

You have to open froogle.php and set your FTP settings there.

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I seem to not be connecting either. I get no error messages, but I do not get the messages in admin "Connected to...." and "Uploading..."

I only get the "File completed..." line. I have un-commented the FTP area, and the feed file looks good and is chmod 777.

 

Here is my froogle.php (I have *****'d out identifying info at the request of the store owner):

 

<?php
//  Start TIMER
//  -----------
$stimer = explode( ' ', microtime() );
$stimer = $stimer[1] + $stimer[0];
//  -----------


$OutFile = "../feeds/*****.txt"; //"CHANGEME-full-path-to-file-with-777-dir-and-file-permissions.fr-outfile.txt";
$destination_file = "*****.txt";  //"CHANGEME-filename-to-upload-to-froogle.txt";
$source_file = $OutFile;
$imageURL = 'http://www.*****.com/shop/images/';
$productURL = 'http://www.*****.com/shop/product_info.php?products_id=';
$already_sent = array();

$home = "localhost";
$user="*****";
$pass="*****";
$base="*****";

$ftp_server = "hedwig.google.com";
$ftp_user_name = "*****";
$ftp_user_pass = "*****";
$ftp_directory = ""; // leave blank for froogle

$taxRate = 7; //default = 0 (e.g. for 17.5% tax use "$taxRate = 17.5;")
$taxCalc = ($taxRate/100) + 1;  //Do not edit
$convertCur = true; //default = false
$curType = "USD"; // Converts Currency to any defined currency (eg. USD, EUR, GBP)
if($convertCur)
{
$productURL = "http://www.*****.com/shop/product_info.php?currency=" . $curType . "&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 = 0;
$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 = "CAD";  //this is not binary.
$feed_language = 0;
$default_feed_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_quantity AS quantity,
products.products_status AS prodStatus,
FORMAT( IFNULL(specials.specials_new_products_price, products.products_price) * " . $taxCalc . ",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 )
left join specials on ( specials.products_id = products.products_id AND ( ( (specials.expires_date > CURRENT_DATE) OR (specials.expires_date = 0) ) AND ( specials.status = 1 ) ) )

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( (isset($catTempPar[$curID])) && ($catTempPar[$curID] != 0) )
{
 if(isset($catIndex[$catTempPar[$curID]]))
 {
	 $temp=$catIndex[$catTempPar[$curID]];
 }
 else
 {
	 $catIndex = findCat($catTempPar[$curID], $catTempPar, $catTempDes, $catIndex);
	 $temp = $catIndex[$catTempPar[$curID]];
 }
}
if( (isset($catTempPar[$curID])) && (isset($catTempDes[$curID])) && ($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);
}

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

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

$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($feed_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) );

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

$loop_counter = 0;

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

if( $row->prodStatus == 1 || ($optional_sec == 1 && $instock == 1) )
{

 if($convertCur)
 {
	 $row->price = ereg_replace("[^.0-9]", "", $row->price);
	 $row->price = $row->price *  $row3->curUSD;
	 $row->price = number_format($row->price, 2, '.', ',');
 }

 $output .= $row->product_url . "\t" .
 preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" .
 preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\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($feed_language == 1)
	 $output .= " \t " . $default_feed_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;


$loop_counter++;
if ($loop_counter>750) {
$fp = fopen( $OutFile , "a" );
$fout = fwrite( $fp , $output );
fclose( $fp );
$loop_counter = 0;
$output = "";
}
}

$fp = fopen( $OutFile , "a" );
$fout = fwrite( $fp , $output );
fclose( $fp );
echo "File completed: <a href=\"" . $OutFile . "\" target=\"_blank\">" . $destination_file . "</a><br>\n";
chmod($OutFile, 0777);

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

 

Any help greatly appreciated :D

Link to comment
Share on other sites

We have our FTP setup.  FlyingMonkey says that our host may not support the ftp connect funtion.  Is there any way we can upload to froogle without the ftp connect funtion.

 

Thank you,

 

Marvin

 

 

Sure, just go to Froogles web site and log in.

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Question...

 

When I log into froogle it says:

Black Widow Security    blackwidowsecurity    Active -  help    -  details    110

 

110.... as in a 110 active products; but I have no where near that many showing up....

 

http://froogle.google.com/froogle?q=store%...=Search+Froogle

 

Any ideas why?!?!?

 

Thanks.

 

Nate

Edited by JEWbacca
Link to comment
Share on other sites

When we install the froogle uploader and we set it up it give us this error

 

File completed: dutchpipeltd.txt

 

Fatal error: Call to undefined function: ftp_connect() in /usr/www/users/marvinlb/catalog/admin/froogle.php on line 313

It creates the file but does not upload it to froogle.

We have uncommented the ftp block but we still get this error.

 

Thank you,

I had exactly the same problem. There is an alternate method of uploading to Froogle in this post.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

My feed has finally been approved. Status is 'succes' and it says in the Merchant Centre that all of my 397 products are active. But if I look in Froogle itself for my store my products don't show up.

 

I have already send an email to Froogle to ask them about it, but they are not known for answering quickly, so I thought I'd try here. Did it take a while after getting your feed approved and active before the products actually showed up?

 

Thanks,

RojanUK

Link to comment
Share on other sites

I answered my own question. I've checked the link in the Merchants Centre, but that's the American site. I'm only listed on Froogle UK. When I do a search there I do get results. But I have two problems. Only 9 of the 397 active products actually show up and none of the pictures are displayed. I checked the feed file and the picture URLs are correct. Any idea why the pics are not displayed or where the rest of my products are?

 

Thanks,

RojanUK

Link to comment
Share on other sites

How are you searching? Also, you have to remember that products show at random with thousands of other merchants so your products will not show up on every search.

 

I recommend everyone to install the following contributions in order to see exactly who is showing up at your site and where they are coming from.

 

Who's Online Enhancement

http://www.oscommerce.com/community/contributions,824

 

whos_online HTTP Referer

http://www.oscommerce.com/community/contributions,2271

Edited by PopTheTop

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I'm searching by going to http://froogle.google.co.uk and typing into the search box: store:worldwidewonders_co_uk. Searching that way all my products should be found, but only 9 of them show up. Also, the images are not being displayed despite the links being correct in the feed file.

 

I've already got the Who's Online enhancement installed, but that serves no purpose in answering the above question.

RojanUK

Link to comment
Share on other sites

Today it's 81 products out of 397 and still no images.  :'(

 

It's up to 169 products now and still no images.

 

My feed initially took around 2 days to show up in its entirety, when I upload new files they can take 3 days or more to fully replace what's there.

 

I have no idea why your images aren't showing though.

 

Sorry.

 

Regards

 

Peter

Link to comment
Share on other sites

Hi, im getting the following error message when i go to admin/froogle.php:

 

Warning: ftp_login(): Login incorrect. in /home/abdhqx/public_html/admin/froogle.php on line 320

FTP connection has failed!

Attempted to connect to hedwig.google.com for user spektral

 

Script timer: 0.840720 seconds.

 

Ive checked the username/pw. Any idea why this is?

 

Cheers Matt.c

Link to comment
Share on other sites

It's up to 169 products now and still no images.

 

My feed initially took around 2 days to show up in its entirety, when I upload new files they can take 3 days or more to fully replace what's there.

 

I have no idea why your images aren't showing though.

 

Sorry.

 

Regards

 

Peter

 

 

The images....make sure they have no spaces in or they won't show.

I had to change mine.

 

eg. nice pic.jpg would need to benice_pic.jpg or nicepic.jpg

 

Steve

Link to comment
Share on other sites

I thought I posted the fix for the missing images here, but here it is again. The problem is caused by spaces in the filename. This piece of code will replace filename spaces with %20. Open up admin/froogle.php

 

Find this around line 236:

$row->image_url . "\t" .

 

and replace it with this:

str_replace(" ","%20",$row->image_url) . "\t" .

 

THAT'S IT! it's that simple.

Link to comment
Share on other sites

I ended up having to manually upload the feed.

My feed was rejected for 2 reasons:

- a few of the images showed up from /array/ instead of /images/,

- also because the cart default is CAD funds (with an option for US and Euro), and due to Froogle taking a week to approve it, the US funds conversion they saw on the site, was different than the feed conversion.

 

Thought I'd mention the /array/ problem, in case this is why others' images aren't showing up.

Link to comment
Share on other sites

I notice the path to your images is http://www.worldwidewonders.co.uk/images

 

is your catalog installed at the root or in a sub like /catalog?

 

just a thought...

 

F5

It's installed at the root.

 

If I cut and paste the path to the images from the feed file into a blank browser window it shows the image, so the path is correct.

RojanUK

Link to comment
Share on other sites

I thought I posted the fix for the missing images here, but here it is again.  The problem is caused by spaces in the filename.  This piece of code will replace filename spaces with %20.  Open up admin/froogle.php

 

Find this around line 236:

$row->image_url . "\t" .

 

and replace it with this:

str_replace(" ","%20",$row->image_url) . "\t" .

 

THAT'S IT!  it's that simple.

I've made the changes and I've uploaded the file. Have to wait and see whether it's going to help. Personally I doubt it very much, since I have no spaces in my imagenames to begin with. Nothing to replace. Nothing to be solved. I fear that the answer has to be found somewhere else.

 

In the meantime I still haven't received an answer from Google self about this problem, but then again, they are not the fastest people in the world. *grin*

RojanUK

Link to comment
Share on other sites

I'm using CRON and the instructions on my C-panel state to use the http://www.popthetop.com/catalog/ address of the file and the help file states to use the absolute path of /home/popthet/public_html/catalog/

 

Well, with the http:// address, nothing ever happened. So I changed it to the absolute path. Now I get the following message e-mails to me:

/bin/sh: line 1: /home/popthet/public_html/catalog/admin/froogle.php: Permission denied

 

How can I give access permission to CRON?

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

if I remember correctly, cron usually runs as root (though that doesn't sound exactly right - - that'd give the average user rights to run with root-equivalency . . .) but just to rule out permissions issues, try chmodding it to 777.

 

FWIW, Mine (I just checked) is currently set to 644.

 

??

 

-jared

Link to comment
Share on other sites

I've made the changes and I've uploaded the file. Have to wait and see whether it's going to help. Personally I doubt it very much, since I have no spaces in my imagenames to begin with. Nothing to replace. Nothing to be solved. I fear that the answer has to be found somewhere else.

 

In the meantime I still haven't received an answer from Google self about this problem, but then again, they are not the fastest people in the world. *grin*

Last night my cron job uploaded the weekly feed file - using the change in the froogle.php - but there still aren't any pictures, the links when copied into a blank browser still seem to work fine and google/froogle still hasn't answered my email. I'm still at a loss... :'(

RojanUK

Link to comment
Share on other sites

I am having problems with froogle "image not availble" but the file is right it looks like and they have no spaces in the names, anyone know why most but not all of my froogle images may not be showing on froogle?

 

Thanks.

The way of life, and the way we work for you.

Link to comment
Share on other sites

I've just ran a test. All my products, with the exception of two, have image unavailable. When I copy the full image address and load it in a blank browser window I get the 'image unavailable' thing as well. However, if I only copy the actual path of the image from the full image address it is actually the correct path. So, the problem is to do with the bits that Froogle puts around it.

 

For example:

This is the full image address:

This gives me an 'image unavailable'.

 

However, if you try just the actual path:

the right image is shown.

 

The two products that do have a picture seems to have gotten their picture from a totally different location (http://im.edirectory.com) which I've never heard off.

 

So, I don't know what's going on or how to solve it. I find the whole thing rather odd. And Froogle doesn't answer the question I send to them by email either, so thats not helping...

Edited by RojanUK

RojanUK

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