Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Froogle Google

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 07-29-2003, 03:36 AM
  kpayne's Avatar 
kpayne kpayne is offline
 

X-Adept
  
Join Date: Dec 2002
Location: Firetanksoftware.com
Posts: 469
 

Default

Ah, in that case, I've gotten 9 clicks. I'm sure like 5 of those were in-house clicks.
__________________
X-cart Featured Products Manager from http://www.firetanksoftware.com - Put your products where you want, how you want.
Reply With Quote
  #32  
Old 07-29-2003, 05:04 AM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

Quote:
For those that want to actually see what is being generated, you can modify the php above like this...

# $fp = tmpfile();

$fp = fopen("./froogle_temp.txt", "w+");

How would I set it to download the froogle feed to a directory on my website server? That way I could set a cron tab to do this - give it a quick check and submit it myself. I like to check what is being auto-generated before submitting.
Reply With Quote
  #33  
Old 07-29-2003, 07:30 AM
 
HairGuy HairGuy is offline
 

Member
  
Join Date: Oct 2002
Posts: 12
 

Default How to test it

To test the froogle_update.php script, just set the following variables (in the config.php file) to point to your FTP server:

$froogle_host = your FTP host
$froogle_username = your FTP username
$froogle_password = your FTP password

If you do this, it will send the export file to your FTP server (instead of Google's).
Reply With Quote
  #34  
Old 08-04-2003, 05:20 AM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

It is putting in an extra slash / following the .com - example
Code:
http://officeemergencysupplies.com//customer/product.php?productid=16134
Where can I remove the extra / in the froogle code?
Reply With Quote
  #35  
Old 08-05-2003, 09:56 AM
 
HairGuy HairGuy is offline
 

Member
  
Join Date: Oct 2002
Posts: 12
 

Default

Check the setting of the $xcart_web_dir variable in config.php. It is probably set to '/'.

The product URL uses $http_location to build the link, so check to see if it has a trailing slash. If it does, you could use preg_replace() to remove it.
Try this:

Code:
$product_url = preg_replace('/\/$/', '', $http_location).'/customer/product.php?productid='.$products[$key][productid].$partner_track;

You may also need to do the same thing to $image_url

If the above does not work, then you may be using a version of X-Cart that I am not familiar with.
Reply With Quote
  #36  
Old 08-05-2003, 12:09 PM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

Thank you, worked like a charm.
Reply With Quote
  #37  
Old 08-05-2003, 01:55 PM
 
successful successful is offline
 

eXpert
  
Join Date: Sep 2002
Location: Brooklyn
Posts: 208
 

Default

Quote:
Originally Posted by davesphoto
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!


Hmmm.....I tried this and Google responded as follows:

Thank you for submitting your data feed. We have reviewed your feed and
need you to make some changes so that we can successfully process your
feed.

Please remove the first line of "$line = "\n";" from your data feed.
Please also separate the header and each product from other products by
using a line break. For example, after the shipping field for each
product, there should be a line break to separate it from the next
product.

After you have made this change, please upload a new version of your feed
with the same filename as before, and email us so that we can check the
new version.



Any suggestions ?
__________________
Visit us at http://www.Successfulhosting.com
We\'ll make your web site a success!

Register your own domain name for only $14.99 at http://DiscountDomainRegistry.com
Reply With Quote
  #38  
Old 08-05-2003, 04:56 PM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

Quote:
Any suggestions ?

Yes use the froogle_update.php mod from HairGuy on the previous page. It is the best!!! I think x-cart developers should include it in the x-cart package.
Reply With Quote
  #39  
Old 08-05-2003, 06:47 PM
 
cloud9 cloud9 is offline
 

Advanced Member
  
Join Date: Dec 2002
Posts: 43
 

Default

Yep, HairGuy's script rocks. The only things I had to tweak to get my feed accepted by Froogle was to remove the offer_id (I didn't have any), and modify the script to not add an image link if I didn't actually have an image for a product.
Reply With Quote
  #40  
Old 08-05-2003, 07:40 PM
 
jgkiefer jgkiefer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 85
 

Default

Quote:
Originally Posted by cloud9
modify the script to not add an image link if I didn't actually have an image for a product.

Oop's I forgot about that. How did you modify the code to not add an image link for products with no images?

What's an offer_id?
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:47 PM.

   

 
X-Cart forums © 2001-2020