Jump to content
gottaloveit

Automatically send data feed to Froogle

Recommended Posts

Can anyone offer some code to truncate the title name to 150 characters? I've gone over the limit on a few and would like to just truncate for the feed. 

 

Thank you in advance for your help. 

Share this post


Link to post
Share on other sites

In the googlefeeder.php file, find

products_description.products_name AS name,

and change it to

substr(products_description.products_name, 0, XX) AS name,

where XX is the length you want.

Share this post


Link to post
Share on other sites

Thank you Jack.

 

I have concat in there and I am not sure where to put the substr. Here's my line:

CONCAT(products_description.products_name ,' - ' ,categories_description.categories_name) AS name,

 

I'm having so many issues and I cannot figure out why. 

 

1. I have my identifier set to 0 but it's not coming through the feed as False. (its not in the feed at all).

 

2. My condition is set to 1 and the option is set to "Refurbished" however google is stating that the condition is missing from the feed. 

 

3. I have weight set to 1 and the accepted methods set to lb. google error shows it is missing from the feed. 

 

4. I have the google product category set to 1 and the option at 855. I'm getting a warning that this is not in the feed either. 

 

 

I have looked over this so long I cannot see why it's omitting just these things. 

 

Can you please help?


Share this post


Link to post
Share on other sites

@ My last version doesn't have the code you mention so I can't help you with that. But if it has $row->name, then change that to

substr($row->name, 0, XX)

The XX is the length. There are two instances of that in my file.

 

For the other things:

1 - The identifier only works for some of the other options: Brand, GTIN, MPN.

 

2 - Have you looked at the feed yourself? Is the column actually missing?

 

3 - Same as 2.

 

4 - Same as 2. Although I don't recall if I tested to see if the feed will handle the new ID's. You can try entering the actual string. But the column heading should appear either way so if it doesn't, your options may not be correct.

Share this post


Link to post
Share on other sites

For different reasons I never set this up.  So, to the people using these kind of feeds, does it work well and do you think it's worth it?  I've been using Adwords for over 10 years and it doesn't yield a lot of sales for the money spent. 


I'm not really a dog.

Share this post


Link to post
Share on other sites

@@John W This feed is for google shopping and is different than adwords. You need an adwords campaign setup to use google shopping but the results are different. When goggle started charging for this service, it made it more difficult for it to be of use since the results depends on how much you spend in the adwords campaign. But if you can get your product seen in google shopping, it can make a big difference in traffic to your site.

Share this post


Link to post
Share on other sites

I downloaded the most recent addon. I've used the google feeder file with the changes for my ftp information. 

 

I have edited the following: 

define('OPTIONS_ENABLED', 0);
define('OPTIONS_ENABLED_AGE_RANGE', 0);
define('OPTIONS_ENABLED_ATTRIBUTES', 0);
define('OPTIONS_ENABLED_BRAND', 0);            //if set, see options for this setting below
define('OPTIONS_ENABLED_CONDITION', 1);
define('OPTIONS_ENABLED_CURRENCY', 0);
define('OPTIONS_ENABLED_EXPIRATION', 1);
define('OPTIONS_ENABLED_FEED_LANGUAGE', 0);
define('OPTIONS_ENABLED_GTIN', 0);              
define('OPTIONS_ENABLED_GOOGLE_PRODUCT_CATEGORY', 1); 
define('OPTIONS_ENABLED_GOOGLE_UTM', 0);
define('OPTIONS_ENABLED_IDENTIFIER_EXISTS', 0); 
define('OPTIONS_ENABLED_ISBN', 0);              
define('OPTIONS_ENABLED_MADE_IN', 0);
define('OPTIONS_ENABLED_MPN', 0);               
define('OPTIONS_ENABLED_PRODUCT_MODEL', 0);     
define('OPTIONS_ENABLED_PRODUCT_TYPE', 1);
define('OPTIONS_ENABLED_SHIPPING', 0);
define('OPTIONS_ENABLED_INCLUDE_TAX', 0);       
define('OPTIONS_ENABLED_UPC', 0);               
define('OPTIONS_ENABLED_WEIGHT', 1);
define('OPTIONS_AGE_RANGE', '20-90 years');
define('OPTIONS_AVAILABILITY', 'quantity'); 
define('OPTIONS_BRAND', 'name');                
define('OPTIONS_CONDITION', 'Refurbished');             
define('OPTIONS_CURRENCY', 'USD');
define('OPTIONS_CURRENCY_THOUSANDS_POINT', ','); 
define('OPTIONS_DATE_FORMAT', 'Y-m-d');         
define('OPTIONS_FEED_LANGUAGE', 'en');
define('OPTIONS_GOOGLE_UTM', '?utm_source=GoogleBase1&utm_medium=BaseFeed1&utm_campaign=products'); 
define('OPTIONS_GOOGLE_PRODUCT_CATEGORY', '855');  
define('OPTIONS_GTIN', '');
define('OPTIONS_ISBN', '');
define('OPTIONS_MADE_IN', 'US');
define('OPTIONS_MPN', 'model'); 
define('OPTIONS_PRODUCT_TYPE', 'full');
define('OPTIONS_SHIPPING_STRING', 'US:FL:Ground:7.00');
define('OPTIONS_TAX_RATE' , '20.0');
define('OPTIONS_TAX_CALC', (OPTIONS_ENABLED_INCLUDE_TAX == 2 ? (OPTIONS_TAX_RATE/100) + 1 : '1')); 
define('OPTIONS_UPC', '');
define('OPTIONS_WEIGHT_ACCEPTED_METHODS', 'lb'); 
define('OPTIONS_IGNORE_PRODUCT_PRICE', 1);  
define('OPTIONS_IGNORE_PRODUCT_ZERO', 1);  



I sent the feed and when I view it the column headers and content only show this: 

 

link    title    description   price   image_link id   availability


Can you tell me what I'm doing wrong?

 

I do not have upc/mpn/isbn, etc. So I need the column to show for Identifier exists with false in each row. 

 

I have a table rate for shipping which I've set up in google merchant. 

Share this post


Link to post
Share on other sites

@@Jack_mcs

Thanks and I'll look at this more.  I noticed Google strongly recomends using SFTP, so I may add that function.  If I get that working i'll post back.


I'm not really a dog.

Share this post


Link to post
Share on other sites

I've not seen a case where google accepts a feed without one if the unique identifiers set, though your site may be able to do that. It won't hurt, and may help, if you enable at least one, like Brand or MPN, then you can also enable the label. But to use any of the options, you have to have OPTIONS_ENABLED set to 1.

Share this post


Link to post
Share on other sites

In the past google has allowed us an exemption. I haven't been staying up to date on my feeds so I'm trying to get back into it. I was going by this line on the feed specifications. 

 

https://support.google.com/merchants/answer/188494?hl=en

 

 

In the rare situation where your product has neither a GTIN nor MPN (for example, made-to-order or handmade products), set 'identifier exists' to 'FALSE' to indicate that you have no identifier for the product.

Share this post


Link to post
Share on other sites

Try this: Change

define('OPTIONS_ENABLED_IDENTIFIER_EXISTS', 0); 

to

define('OPTIONS_ENABLED_IDENTIFIER_EXISTS', 99); 

Change

   if(OPTIONS_ENABLED_IDENTIFIER_EXISTS == 1 && $identfierCtr > 1)  $output .= "\tidentifier exists";

to

   if(OPTIONS_ENABLED_IDENTIFIER_EXISTS == 99 || (OPTIONS_ENABLED_IDENTIFIER_EXISTS == 1 && $identfierCtr > 1))  $output .= "\tidentifier exists";

Change

         if (OPTIONS_ENABLED_IDENTIFIER_EXISTS == 1 && $identfierCtr > 1) {

to

         if (OPTIONS_ENABLED_IDENTIFIER_EXISTS == 99 || (OPTIONS_ENABLED_IDENTIFIER_EXISTS == 1 && $identfierCtr > 1)) {

Share this post


Link to post
Share on other sites

Hi Jack @@kymation,

 

 

maybe i am stupid, I did'n find the answer on my question in this threet.

Installed v3.4 changed the feeders_2.3_only to feeders.php as in manual.

Upload the addon & open it : 

GoogleBase V 3.3 !!!

Check for updates, 1 update found, download it, seems the same addon !!! 

Why the pack named v 3.4 & I read in the adminsite->Tools-Google Base V 3.3???

 

saludos

Share this post


Link to post
Share on other sites

The 3.3 upload had a mistake so I uploaded a new version but forgot to change the version number. The 3.4 package is the correct one to use. Also, it doesn't contain a file named feeders_2.3_only so you've made a mistake with the installation.

Share this post


Link to post
Share on other sites

Hi Jack,

 

First, thanks for all your great contributions over the years and the tireless way that you support them.

 

Second, I'm having a small problem with version 3.4 of this contribution in OsC 2.3.4 BS responsive.

 

OK, I see now that I'm NOT having a problem with it and I must have done something LOL.

 

Regards.

Edited by Druid6900

No Good Deed EVER Goes Unpunished

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

 

  • Added google label option.
  • Changed age range to age group.
  • Changed the skip category code to include immediate category as well as parents.
  • Changed code to handle taxes for each item.
  • Changed the Identifier option to allow it to always show False if set to 99.
  • Fixed the Identifier code to properly sense when it is needed.
  • Fixed coding mistake in the Bing feeder file.
  • Fixed counter that was reporting added products incorrectly.

If you use this addon and have products that have a GTIN number, be sure you have added a field to the database named products_gtin and that it is populated correctly for your products. Then enable that option in the googlefeeder.php file. Google is changing the rule for this in a week so your feed will fail if this isn't setup.

Share this post


Link to post
Share on other sites

Hi

 

Is there a simple way I can edit the weight field to use it for gtin (Barcode)  Please. So I can enter my barcode in the weight field which I do not use.

 

Using Bootstrap Master.

 

Many thanks

Edited by jamo32

Using Bootstrap 8-)

Share this post


Link to post
Share on other sites

No, the weight field won't work due to how it is declared in the database. You could change that and then it would work as you want, though you would need to edit the googlefeeder.php file to use it. But that is not a good way to do it since the weight field is a standard field and should you ever have need of it, your shop will not work correctly.

 

The latest version of Bootstrap has the gtin code already added. All you would need to do is add it as a database field and add the changes to the admin/categories.php file by using a compare program. It is not a big change but that depends on your level of experience with making such changes.

Share this post


Link to post
Share on other sites

Thanks Jack for all your help over the time I have used this forum 8-)

 

I was managed to add an extra field in my sites admin products for gtin (barcodes/ean), I just duplicated the mentions of model field ,copied and pasted it then edited it to products_gtin in the admin/categories file and did the same with one line in the admin/includes/languages/english/categories  the same.

 

then in my sites phpmyadmin  in the "products" data base added a new column products_gtin

 

There was some fist pumps in the air after I seeing it worked LoL

 

Hope the above helps someone out 8-)

Edited by jamo32

Using Bootstrap 8-)

Share this post


Link to post
Share on other sites

Hi Jack,

 

Just installed, I'm having an issue with utf8 or something similar, I think.

 

For non-english characters, I realized that they appear correctly (ore at least, valid) in "description" column, but not in "title" column, in which they appear with strange simbols.

 

A couple of examples (bolds are mine):

· If I write "Eñes", in title will appear as "Eñes", while in description it will appear as "Eñes"

· If I write "ácéntós", in title will appear as "ácéntós", while in description it will appear as "ácéntós"

 

I'm only testing it locally, but I'm not sure if Google will accept such strange characters. I suppose not, or in the best case, it would be seen very strange in Google Shopping listings.

 

I've changed define('OPTIONS_ENABLED_FEED_LANGUAGE', to 1 and define('OPTIONS_FEED_LANGUAGE', 'es'); (es=spanish)

Please, can you give me any idea of what else can I change and try?
 

I've also modified googlefeeder.php for not including products without GTIN, since from last monday it is always needed.

Many thanks for your contribution!

 

Regards
 

Oops! Forgot to mention... Installed on a 2.3.4 BS Gold. All tables in database collated in utf8_unicode_ci


Shopowner, not coder, experienced copypaster  :D

Share this post


Link to post
Share on other sites

I haven't tested the following but it may help. In the googlefeeder.php file, find

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

and replace that with

      htmlentities(preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ), ENT_COMPAT, 'UTF-8') . "\t" .
      htmlentities(preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ), ENT_COMPAT, 'UTF-8') . "\t" .

Share this post


Link to post
Share on other sites

Many thanks, @@Jack_mcs !!

 

It works properly and really fine! Now I see that it is correct in txt format. In csv format it still have the same problem, (overall because as you say, it is still in development).
 

As a minor question, if you are interested, I've configurated "brand" as "manu" (for displaying manufacturers). I've seen that in the case a certain product doesn't have any manufacturer assigned, this column shows instead product name again. In this situation, again strange characters appear. But this is not a problem, at least for me.

 

Regards.


Shopowner, not coder, experienced copypaster  :D

Share this post


Link to post
Share on other sites

For any part that would have accented characters, you would have to apply the change. For brand, find in the code where it shows $row->brand and change it to

htmlentities($row->brand, ENT_COMPAT, 'UTF-8')

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

×