Thread: Froogle Google
View Single Post
  #23  
Old 07-25-2003, 09:49 AM
 
davesphoto davesphoto is offline
 

Member
  
Join Date: May 2003
Posts: 24
 

Default

I think I got it!
This does not print any extra lines. It also removes any extra tabs created by multiple carrage returns in the description (I am not sure why this happened with the old code but another |strip did the trick). Anyways, this is what I am using now for product_export.tpl:

Code:
{strip} product_url{$delimiter} name{$delimiter} description{$delimiter} price{$delimiter} image_url{$delimiter} category{$delimiter} offer_id{$delimiter} shipping{$line} {section name=prod_num loop=$products} http://www.davesphotoemporium.com/store/customer/product.php?productid={$products[prod_num].productid|replace:"\"":""}&cat={$products[prod_num].categoryid|replace:"\"":""}&partner=froogle{$delimiter} {$products[prod_num].product|replace:"\"":""}{$delimiter} {$products[prod_num].descr|replace:"\r":" "|replace:"\n":" "|replace:"\t":" "|replace:"\"":""|replace:",":","|strip_tags |strip}{$delimiter} {$products[prod_num].price|replace:"\"":""}{$delimiter} http://www.davesphotoemporium.com/store/image.php?productid={$products[prod_num].productid|replace:"\"":""}{$delimiter} {$products[prod_num].category|replace:"/":" > "|replace:"\"":""}{$delimiter} {$products[prod_num].productcode|replace:"\"":""}{$delimiter} 0.00{$line} {/section} {/strip}

Now be carefull! This tpl seems very sensitive to extra spaces or lines in the code, so don't leave any! Also notice I am using the short description, not the full one (I dont use it for display on the website so now it is the "froogle" description).

Also please note: You must define and assign the variable $line as the line delimiter in the export.php.

Put this at the top:
Code:
$line = "\n";

And this right after $smarty->assign("delimiter", $delimiter);:
Code:
$smarty->assign("line", $line);


This should export data ready for upload to froogle without modification (at least it does for me ).

I am not a programmer and do not know all the etiquette so I hope I am not stepping on any toes posting this code seeing as how some of the lines are unchanged from the code posted earlier in the discussion. The idea is quite different though. Anyway, I make no claim to the code; use it for anything you want! Hopefully it helps!
Reply With Quote