Jump to content
gottaloveit

Automatically send data feed to Froogle

Recommended Posts

It appears that the error message from Google was incorrect. There may be something wrong with your feed file. Use your browser and View Source to check the file. If you can't see anything wrong, post the first few lines here and I'll see if I can spot it.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
It appears that the error message from Google was incorrect. There may be something wrong with your feed file. Use your browser and View Source to check the file. If you can't see anything wrong, post the first few lines here and I'll see if I can spot it.

 

Regards

Jim

 

Jim,

The problem is that i do not have a file, just a name that i use in RewriteRule. The contribution i am using suppose to generate the feed for me, so i don't have anything i can look at. Is there a way to may be log what it does?

Thank you very much for your help.

Share this post


Link to post
Share on other sites

The rewrite rule just changes the filename. There has to be a file for it to change the name of. If you can't see it in your browser, Google can't see it either.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
The rewrite rule just changes the filename. There has to be a file for it to change the name of. If you can't see it in your browser, Google can't see it either.

 

Regards

Jim

 

Hi Jim,

Thank you so much for your help, i really appreciate it.

I am very new to all this, the following is a rewrite rule in my .htaccess

 

RewriteRule googlebaseOut.txt googlebase.php

 

So the way i understand it, it starts googlebase.php, but how do i look at the result created by googlebase.php?

The following is a code for googlebase.php

 

Thanks again.

 

<?php

/*

Title: Google Base Auto Feeder 1.2

This feeder has been revised to work with Ultimate SEO URLs 2.1d (http://www.oscommerce.com/community/contributions,2823)

*/

 

// ########## BEGIN CONFIGURATION ###################

 

// START Main Configuration

// CHANGEME - Change to 'false' to disable the use of SEO

define('SEO_ENABLED','true');

 

// CHANGEME - Change this to the id of your language. BY default 1 is english

$languages_id = 1;

 

// CHANGEME - Change this to Pounds or so

$WeightUnit = " LBS";

//End Main Configuration

 

// START Optional Advance Configuration

// Monetary Adjustments for Products in Feed

// default = 0 (e.g. for 17.5% tax use "$taxRate = 17.5;")

$taxRate = 0;

 

// Do not edit this

$taxCalc = ($taxRate/100) 1;

 

// default = true

$convertCur = true;

 

// Converts Currency to any defined currency (eg. USD, EUR, GBP)

$curType = "USD";

//END Optional Advance Configuration

 

// START Optional Advance Feed Attributes

// (0=False 1=True) (optional_sec must be enabled to use any of the following options)

$optional_sec = 1;

 

$manufacturer = 0;

 

$mpn = 0; //model no. in osC is used here

 

$payment_accepted = 1;

// CHANGEME - Acceptable values: cash, check, GoogleCheckout, Visa, MasterCard, AMEX, Discover, wiretransfer

$default_payment_methods = "Paypal";

 

$product_type = 0;

 

$currency = 1;

// CHANGEME - Change this to Google Base Currency - USD or so

$default_currency = "USD"; //this is not binary.

 

$model_number = 0;

 

$feed_quantity = 0;

 

$brand = 0; // 31 jan 2007 Added condition due to Google Base making mandatory

 

$condition = 1; // 31 jan 2007 Added condition due to Google Base making mandatory

// CHANGEME - Change this to Old or so

$default_condition = "New"; // 31 jan 2007 Added condition due to Google Base making mandatory

 

$age_range = 1; // 31 jan 2007 Added condition due to Google Base making mandatory

// CHANGEME - Change this to Age Range who could bioew your feeds - 30-60 or so

$default_age_range = "1-90"; // 31 jan 2007 Added condition due to Google Base making mandatory

 

$made_in = 1; // 31 jan 2007 Added condition due to Google Base making mandatory

// CHANGEME - Change this to your country - USA or so

$default_made_in = "USA"; // 31 jan 2007 Added condition due to Google Base making mandatory

 

$shipping = 0;

$lowestShipping = ""; //this is not binary. Custom Code is required to provide the shipping cost per product. ###needs to be an array for per product.

 

$upc = 0; //Not supported by default osC

 

$location = 0;

// CHANGEME - Change this to your place if enabled

$default_location = "";

 

$feed_language = 1;

// CHANGEME - Change this to Google Base Feed Language - FR or so if enabled

$default_feed_language = "EN"; //this is not binary.

 

$feed_manufacturer_id = 0; //this is for the manufacturer model number, NOT your internal store sku

// END Optional Advance Feed Attributes

 

// ########## END CONFIGURATION ###################

//Please avoid editing the codes below

 

$feed_exp_date = date('Y-m-d', time() 2592000 );

 

require_once('includes/configure.php');

require_once('includes/filenames.php');

require_once('includes/database_tables.php');

 

$home = DB_SERVER;

$user=DB_SERVER_USERNAME;

$pass=DB_SERVER_PASSWORD;

$base=DB_DATABASE;

$catalogURL = HTTP_SERVER.'/';

$imageURL = HTTP_SERVER.'/'.DIR_WS_IMAGES;

 

if(SEO_ENABLED=='true'){

include_once('includes/classes/seo.class.php');

$seo_urls = new SEO_URL($languages_id);

 

function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {

global $seo_urls;

return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);

}

}

 

if(SEO_ENABLED=='true'){

$productURL = 'product_info.php';

$productParam = "products_id=";

}else{

$productURL = HTTP_SERVER.'/product_info.php/products_id/';

}

 

$already_sent = array();

 

if($convertCur)

{

if(SEO_ENABLED=='true'){

$productParam="" . $curType . "&products_id=";

}else{

$productURL = HTTP_SERVER."/product_info.php?currency=" . $curType . "&products_id="; //where CURTYPE is your currency type (eg. USD, EUR, GBP)

}

}

 

 

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 AS 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(">" => "> ", "®" => "", "®" => "", "™" => "", "™" => "", "\t" => "", " " => "");

 

$output = "link\ttitle\tdescription\texpiration_date\tprice\timage_link\tgenre\tid\tweight";

//create optional section

if($optional_sec == 1)

{

if($shipping == 1)

$output .= "\tshipping";

if($manufacturer == 1)

$output .= "\tmanufacturer";

if($model_number==1)

$output .= "\tmodel_number";

if($upc == 1)

$output .= "\tupc";

if($mpn == 1)

$output .= "\tmpn";

if($payment_accepted == 1)

$output .= "\tpayment_accepted";

if($product_type == 1)

$output .= "\tproduct_type";

if($currency == 1)

$output .= "\tcurrency";

if($location == 1)

$output .= "\tlocation";

if($feed_language == 1)

$output .= "\tlanguage";

if($feed_manufacturer_id == 1)

$output .= "\tmanufacturer_id";

if($feed_quantity == 1)

$output .= "\tquantity";

if($brand == 1) // 31 jan 2007 Added condition due to Google Base making mandatory

$output .= "\tbrand"; // 31 jan 2007 Added condition due to Google Base making mandatory

if($condition == 1) // 31 jan 2007 Added condition due to Google Base making mandatory

$output .= "\tcondition"; // 31 jan 2007 Added condition due to Google Base making mandatory

if($age_range == 1) // 31 jan 2007 Added condition due to Google Base making mandatory

$output .= "\tage_range"; // 31 jan 2007 Added condition due to Google Base making mandatory

if($made_in == 1) // 31 jan 2007 Added condition due to Google Base making mandatory

$output .= "\tmade_in"; // 31 jan 2007 Added condition due to Google Base making mandatory

}

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

}

 

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 && $quantity == 1) )

{

 

if($convertCur)

{

$row->price = ereg_replace("[^.0-9]", "", $row->price);

$row->price = $row->price * $row3->curUSD;

$row->price = number_format($row->price, 2, '.', ',');

}

 

if(SEO_ENABLED=='true'){

$output .= tep_href_link($productURL,$productParam . $row->id) . "\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" .

$feed_exp_date . "\t" .

$row->price . "\t" .

$row->image_url . "\t" .

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

$row->id . "\t" .

$row->weight . $WeightUnit;

}else{

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

$feed_exp_date . "\t" .

$row->price . "\t" .

$row->image_url . "\t" .

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

$row->id . "\t" .

$row->weight . $WeightUnit;

}

 

//optional values section

if($optional_sec == 1)

{

if($shipping == 1)

$output .= "\t" . $lowestShipping;

if($manufacturer == 1)

$output .= "\t" . $row->mfgName;

if($model_number==1)

$output .= "\t" . $row->prodModel;

if($upc == 1)

$output .= "\t" . $row->prodModel;

if($mpn == 1)

$output .= "\t" . $row->prodModel;

if($payment_accepted == 1)

$output .= "\t" . $default_payment_methods;

if($product_type == 1)

{

$catNameTemp = strtolower($catName);

$output .= "\t" . $row->catName;

}

if($currency == 1)

$output .= "\t" . $default_currency;

if($location==1)

$output .= "\t" . $default_location;

if($feed_language == 1)

$output .= "\t" . $default_feed_language;

if($feed_manufacturer_id == 1)

$output .= "\t" . $row->prodModel;

if($feed_quantity == 1)

$output .= "\t" . $row->quantity;

if($brand==1)

$output .= "\t" . $row->mfgName;

if($condition == 1) // 31 jan 2007 Added condition due to Google Base making mandatory

$output .= "\t" . $default_condition; // 31 jan 2007 Added condition due to Google Base making mandatory

if($age_range == 1) // 31 jan 2007 Added condition due to Google Base making mandatory

$output .= "\t" . $default_age_range; // 31 jan 2007 Added condition due to Google Base making mandatory

if($made_in == 1) // 31 jan 2007 Added condition due to Google Base making mandatory

$output .= "\t" . $default_made_in; // 31 jan 2007 Added condition due to Google Base making mandatory

}

$output .= "\n";

}

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

}

echo $output;

?>

Share this post


Link to post
Share on other sites

Put http://example.com/googlebaseOut.txt in your browser's address bar. Change the example.com to the name of your site. Once you can see the file, use View Source to get the actual file (your browser messes up the formatting.) Save the file from the Source window. You can now upload that file to Google manually. To upload automatically, give Google the same address you just viewed.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
Put http://example.com/googlebaseOut.txt in your browser's address bar. Change the example.com to the name of your site. Once you can see the file, use View Source to get the actual file (your browser messes up the formatting.) Save the file from the Source window. You can now upload that file to Google manually. To upload automatically, give Google the same address you just viewed.

 

Regards

Jim

 

Jim,

 

I just tried it and i got a blank screen. I guess i need to check googlebase.php to make sure i didn't make mistakes while customizing.

 

Do you know if there is a line by line debugger that i can use?

 

Thank you very much.

Share this post


Link to post
Share on other sites

Still having problems with this Jim. Having played with it a bit, I think that the issue is that the googlebase.php file isn't actually coming up with any data. If I navigate to mydomain/googlebase.php I just get a blank screen. I have tried putting a copy into mydomain/catalog and navigating to that, but still a blank file. Any ideas?

 

Cheers,

 

Dan

Share this post


Link to post
Share on other sites

Some hosting services turn off error reporting in PHP. This makes it difficult to find errors. Try adding this to the top of googlebase.php:

  error_reporting(E_ALL);

and see if you get any errors. You could also ask your host for error logs.

 

Note that googlebase.php need to be in your catalog root. If you have installed osCommerce in a folder named catalog/, then that's where the file needs to be. It won't work anywhere else without modification.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hello

 

I use Auto Feeder 1.2.

 

My Problem: When i set 'SEO_ENABLED' to 'false' i always get the message "Error when connecting itself to the data base". With 'SEO_ENABLED' = 'true' i get a blank page.

 

I have no SEO-Contrib installed and i have tested different configuration-settings and different directiory-paths for the $catalogURL as well.

 

I would be grateful for any support.

Edited by Nick-Nick

Share this post


Link to post
Share on other sites

The error indicates that the connection to your database is not working. Make certain that the database section of your catalog/includes/configure.php is correct. Do not use catalog/includes/local/configure.php. Leave the $catalogURL variable alone. Install the googlebase.php file in the root of your store.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

I got it to work and it's all fine but it's displaying all products also the ones that are switched off in the admin ;/ any ideas?

Share this post


Link to post
Share on other sites

That's a bug, or at least a missing feature. Find this code:

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

and add just after that

AND products.products_status='1'

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hi Jim,

 

I finally got the error message for my googlebase.php

 

Warning: include_once(includes/classes/seo.class.php): failed to open stream: No such file or directory in /mysite.com/googlebase.php on line 104 Warning: include_once(): Failed opening 'includes/classes/seo.class.php' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in /mysite.com/googlebase.php on line 104 Fatal error: Class 'SEO_URL' not found in /mysite.com/googlebase.php on line 105

 

Can you help me with this?

 

Thanks.

Share this post


Link to post
Share on other sites

Which SEO contribution are you using?

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
Which SEO contribution are you using?

 

Regards

Jim

 

 

SiteMap_SEO_v_1.4

 

Hopefully this is the only one, in the very beginning i might have tried to install something else, but i believe i rolled back all the changes.

 

Regards

Share this post


Link to post
Share on other sites

That's only a sitemap. The SEO referred to in googlebase.php is for SEO addons that rewrite the page urls. You need to set SEO to false (Line 11 in googlebase.php.)

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
That's only a sitemap. The SEO referred to in googlebase.php is for SEO addons that rewrite the page urls. You need to set SEO to false (Line 11 in googlebase.php.)

 

Regards

Jim

 

 

THANK YOU, THANK YOU, THANK YOU!!!!!

IT WORKS!!!!!

 

Jim,

 

is there a SEO addon that you can recommend? I can not make a choice, since I do not know enough about it, but as i understand i need it.

 

Thanks.

Share this post


Link to post
Share on other sites

Not really, since I pretty much put together my own. I don't believe in URL rewriters, so I don't use them. Header tags are essential, and a good set of sitemaps (both human-readable and XML for the search engines) are a good idea as well. Most important of all, make quality, informative product pages.

 

I suggest that you search this forum for "SEO." You'll find a bunch of recommendations.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hi Jim,

 

I added in the error command that you mentioned before, but am still just getting a blank page when I navigate to googlebase.php

 

Dan

Share this post


Link to post
Share on other sites
Hi Jim,

 

I added in the error command that you mentioned before, but am still just getting a blank page when I navigate to googlebase.php

 

Dan

 

Scrap that, it appears to be working :D

Share this post


Link to post
Share on other sites

Now I'm getting this error trying to upload the file to google base

 

"We didn't understand the delimiter in your data feed"

 

I have it set to Autodetect

Share this post


Link to post
Share on other sites

Are you doing a manual upload? If so, don't save the file from your browser window, that messes up the delimiters. Use View Source and save from there.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Hi Jim,

 

Apparantly I got a bit ahead of myself with the last post. Although my googlebase file is now viewable, Google is returning the message:

 

"Error Bad data Line #

We were unable to connect to the host holding your data feed."

 

Is this something that I can fix, or do I need to contact my host?

 

Cheers,

 

Dan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×