Guest ITechWest Posted May 2, 2008 Share Posted May 2, 2008 Google Base has added a product ID requirement for the upload, this needs to be fixed in export.inc.php, can you guys take a look. I am using 4.1.1 Current Code if ($results == true) { $googleBaseContent = "product_url\tname\tdescription\timage_url\tprice\tcurrency\r\n"; for ($i=0; $i<count($results); $i++) { $salePrice = salePrice($results[$i]['price'], $results[$i]['sale_price']); $price = ($salePrice > 0) ? $salePrice : $price = $results[$i]['price']; $name = str_replace(array(" ","\t","\r","\n","\0","\x0B"," "),"",strip_tags($results[$i]['name'])); $name = str_replace(" ","",$name); $desc = str_replace(array(" ","\t","\r","\n","\0","\x0B"," "),"",strip_tags($results[$i]['description'])); $desc = str_replace(" ","",$desc); if ($config['sef'] == 0) { $googleBaseContent .= $glob['storeURL']."/index.php?_a=viewProd&productId=".$results[$i]['productId']."\t".$name."\t".$desc; } else { include_once("includes".CC_DS."sef_urls.inc.php"); $googleBaseContent .= $glob['storeURL']. "/" .generateProductUrl($results[$i]['productId'])."\t".$name."\t".$desc; } if ($results[$i]['image']) { $googleBaseContent .= "\t".$glob['storeURL']."/images/uploads/".$results[$i]['image']; } else { $googleBaseContent .= "\t".$glob['storeURL']."/skins/".$config['skinDir']."/styleImages/nophoto.gif"; } $googleBaseContent .= "\t".$price."\t".$config['defaultCurrency']."\r\n"; Quote Link to comment Share on other sites More sharing options...
Guest xceejayx Posted May 5, 2008 Share Posted May 5, 2008 yeah i hope this gets sorted :( Quote Link to comment Share on other sites More sharing options...
Guest ITechWest Posted May 5, 2008 Share Posted May 5, 2008 It has, if you are running 4.x, down load the file from 4.2.2 and it fixes this Quote Link to comment Share on other sites More sharing options...
Guest Posted May 6, 2008 Share Posted May 6, 2008 Hi All Simple change: if ($results == true) { $googleBaseContent = "id\tproduct_url\tname\tdescription\timage_url\tprice\tcurrency\r\n"; //ADDED THIS//////////^^^^ for ($i=0; $i<count($results); $i++) { //ADDED THE BELOW LINE $googleBaseContent .= $results[$i]['productId']."\t"; $salePrice = salePrice($results[$i]['price'], $results[$i]['sale_price']); $price = ($salePrice > 0) ? $salePrice : $price = $results[$i]['price']; $name = str_replace(array(" ","\t","\r","\n","\0","\x0B"," "),"",strip_tags($results[$i]['name'])); $name = str_replace(" ","",$name); $desc = str_replace(array(" ","\t","\r","\n","\0","\x0B"," "),"",strip_tags($results[$i]['description'])); $desc = str_replace(" ","",$desc); if ($config['sef'] == 0) { $googleBaseContent .= $glob['storeURL']."/index.php?_a=viewProd&productId=".$results[$i]['productId']."\t".$name."\t".$desc; } else { include_once("includes".CC_DS."sef_urls.inc.php"); $googleBaseContent .= $glob['storeURL']. "/" .generateProductUrl($results[$i]['productId'])."\t".$name."\t".$desc; } if ($results[$i]['image']) { $googleBaseContent .= "\t".$glob['storeURL']."/images/uploads/".$results[$i]['image']; } else { $googleBaseContent .= "\t".$glob['storeURL']."/skins/".$config['skinDir']."/styleImages/nophoto.gif"; } $googleBaseContent .= "\t".$price."\t".$config['defaultCurrency']."\r\n"; What I have done here is use the product ID field in the database as this is a unique field and will never be used again if a product is deleted. Adam Quote Link to comment Share on other sites More sharing options...
Guest xceejayx Posted May 6, 2008 Share Posted May 6, 2008 thanks :) Quote Link to comment Share on other sites More sharing options...
disco_ii_disco Posted May 7, 2008 Share Posted May 7, 2008 Also GoogleBase didn't like the fact that some descriptions were blank. I think I've managed to get around this by adding: ." Click for more info." to the end of line 55 (or 57 if you are using SEF links): $googleBaseContent .= $glob['storeURL']."/index.php?_a=viewProd&productId=".$results[$i]['productId']."\t".$name."\t".$desc." Click for more info."; Quote Link to comment Share on other sites More sharing options...
Guest xceejayx Posted May 9, 2008 Share Posted May 9, 2008 What I have done here is use the product ID field in the database as this is a unique field and will never be used again if a product is deleted. Adam I tried this fix. I get the following errors from google once they have processed the file. EDIT - Nevermind - disco_ii_disco's post fixed the errors. :) Quote Link to comment Share on other sites More sharing options...
Guest jackc Posted May 11, 2008 Share Posted May 11, 2008 Will the above mods work on V3?? TIA, Jack Quote Link to comment Share on other sites More sharing options...
Guest cuber1 Posted July 12, 2008 Share Posted July 12, 2008 Will the above mods work on V3?? TIA, Jack Have the same question. Quote Link to comment Share on other sites More sharing options...
Guest cuber1 Posted July 12, 2008 Share Posted July 12, 2008 http://forums.cubecart.com/index.php?showtopic=34146 The above works. I had to manually shift the cells and include one header, but that's nothing and takes a few secs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.