If this is your first visit, check our documentation. To post, register or login.
Forums / Addon Admin Tools / Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Started by divavocals on 1 Apr 2012, 11:10 PM · Views: 153,737

Results 321 to 340 of 505
19 Apr 2017, 9:51 PM
#321
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Fjolsvith:

There is a PHP command called 'split' that is removed in PHP 7.0 that the 'google_base.php' class uses. If you replace that command word with 'explode', the addon will run on PHP 7.0.
Ya, "split" has been deprecated since PHP 5.3 ... Is your plugin code safe to use on PHP 5.3?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Jun 2017, 1:51 PM
#322
faze3 avatar

faze3

New Zenner

Join Date:
Jan 2009
Posts:
54
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

I am using version 1.14.3 on Zen Cart 1.5.4. All works perfectly but the problem I have is that the weight options are either kilograms or pounds. All my products and postage options are using grams. So a product weighing 350g is exported to Google as 350kg. Up until now, in the merchant centre, I have my postage as 1 - 2000kg as this shows the correct postage price. However, Google are now beginning to flag a few products as "Attribute Shipping Weight is too high". No problem at the moment but they may turn from yellow to red! Is there a way to adjust the coding to allow for grams?
Thanks.

8 Jun 2017, 2:50 PM
#323
hairydog avatar

hairydog

Zen Follower

Join Date:
Sep 2006
Posts:
165
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

The easiest way is to use an SQL query to reduce all the product weights in the database to one thousandth of the current value. No code changes required!

8 Jun 2017, 3:02 PM
#324
faze3 avatar

faze3

New Zenner

Join Date:
Jan 2009
Posts:
54
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

But it's only the product feed that is exporting as kg. The actual product are grams which is correct.

8 Jun 2017, 3:29 PM
#325
hairydog avatar

hairydog

Zen Follower

Join Date:
Sep 2006
Posts:
165
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

No, grammes is incorrect. That's the point. Convert to the correct units and the problem is solved!

19 Jul 2017, 4:16 PM
#326
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Recently having trouble no matter what I do can't get it to work. Have tried everything. Any ideas. Have replaced split with explode, etc. Any point in right direction would help tremendously.

[19-Jul-2017 11:13:08 America/Chicago] Request URI: /googlefroogle.php?feed=fy_un_tp&limit=&offset=&x=27&y=13&key=e5221e8b4d, IP address: 24.34.85.238
#1 trigger_error() called at [/home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home1/thedrah1/public_html/includes/classes/google_base.php:832]
#5 google_base->google_get_products_special_price() called at [/home1/thedrah1/public_html/includes/classes/google_base.php:732]
#6 google_base->google_get_products_actual_price() called at [/home1/thedrah1/public_html/googlefroogle.php:187]

[19-Jul-2017 11:13:08 America/Chicago] PHP Fatal error: 2008:MySQL client ran out of memory :: select sale_specials_condition, sale_deduction_value, sale_deduction_type from zen_salemaker_sales where sale_categories_all like '%,55374,%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0001-01-01') and (sale_date_end >= now() or sale_date_end = '0001-01-01') and (sale_pricerange_from <= '15.9500' or sale_pricerange_from = '0') and (sale_pricerange_to >= '15.9500' or sale_pricerange_to = '0') ==> (as called by) /home1/thedrah1/public_html/includes/classes/google_base.php on line 832 <== in /home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php on line 167

[19-Jul-2017 11:13:08 America/Chicago] PHP Fatal error: 2013:Lost connection to MySQL server during query :: select count(*) as total
from zen_sessions
where sesskey = '12nr8fs56t10n65l5huq3ge5u1' ==> (as called by) /home1/thedrah1/public_html/includes/functions/sessions.php on line 66 <== in /home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php on line 167

Thanks
Sandria

20 Jul 2017, 2:15 PM
#327
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

admin -> tools -> developers tool kit -> Search in Configuration Settings/Keys

type:

memory

press search.

edit:

GOOGLE_PRODUCTS_MEMORY_LIMIT

increase from 128M to 256M

run script again.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

24 Jul 2017, 4:03 AM
#328
yarncharm avatar

yarncharm

New Zenner

Join Date:
Mar 2011
Posts:
20
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

I just recently upgraded to 1.5.5e fresh install and added Merchant Center Feeder 1.14.5.
I immediately encountered a problem with Google reporting the following two errors:
"Unsupported currency in attribute: price" and "Missing required attribute: price"

On inspection of the xml output file, I found the following elements (as example) in each item:

<g:price>8.80</g:price>
<g:currency>USD</g:currency>

Then checking Google's help on the product data attributes for price: https://support.google.com/merchants/answer/6324371
I came to the conclusion that it looks like for xml, that the currency should really be included within the price attribute.

I made the following changes to resolve it at line 380 and line 431 in googlefroogle.php :
line 380 changed from:

$item->appendChild($dom->createElement('g:price', number_format($variants_price, 2, '.', '')));

to:

$item->appendChild($dom->createElement('g:price', number_format($variants_price, 2, '.', '') . ' ' . GOOGLE_PRODUCTS_CURRENCY));

and
line 431 change from

$shipping->appendChild($dom->createElement('g:price', (float)$shipping_rate));

to:

$shipping->appendChild($dom->createElement('g:price', (float)$shipping_rate . ' ' . GOOGLE_PRODUCTS_CURRENCY));

And I made changes similarly at lines 302 and 350 in google_base.php.

I also ended up setting "Show Default Currency" to false in the Google Merchant Center Feed configuration to turn off the <g:currency> field that doesn't seem to be parsing anyway (but it also eliminated the &currency=USD from the URL which is unnecessary on our site, that may not be the case for others.)

In case anyone ran into the same thing, that seems to have taken care of the issue for me.

26 Jul 2017, 7:17 PM
#329
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Unfortunately still having trouble getting a feed. Have tried to inc memory etc. [26-Jul-2017 14:14:13 America/Chicago] PHP Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /home1/thedrah1/public_html/includes/classes/google_base.php:389
Stack trace:
#0 /home1/thedrah1/public_html/includes/classes/google_base.php(389): DOMNode->appendChild(false)
#1 /home1/thedrah1/public_html/googlefroogle.php(500): google_base->universal_attributes(Object(queryFactoryResult), Object(DOMElement), Object(DOMDocument))
#2 {main}
thrown in /home1/thedrah1/public_html/includes/classes/google_base.php on line 389
[26-Jul-2017 14:14:13 America/Chicago] PHP Warning: preg_replace(): Compilation failed: failed to get memory at offset 35 in /home1/thedrah1/public_html/includes/extra_configures/enable_error_logging.php on line 29
[26-Jul-2017 14:14:13 America/Chicago] Request URI: /googlefroogle.php?feed=fy_un_tp&limit=&offset=&x=51&y=2&key=1ea3bb8da8, IP address: 24.34.85.238

[26-Jul-2017 14:14:13 America/Chicago] PHP Fatal error: 2008:MySQL client ran out of memory :: select count(*) as total
from zen_sessions
where sesskey = 'c2oqru0ej8d5f7338vlpmvmai5' ==> (as called by) /home1/thedrah1/public_html/includes/functions/sessions.php on line 66 <== in /home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php on line 167

Thanks
Sandria

26 Jul 2017, 7:40 PM
#330
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

[26-Jul-2017 14:38:47 America/Chicago] PHP Fatal error: Out of memory (allocated 29622272) (tried to allocate 32768 bytes) in /home1/thedrah1/public_html/includes/classes/class.base.php(137) : runtime-created function on line 1

And this one too.
Thanks
Sandria

26 Jul 2017, 8:46 PM
#331
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

It just means that your account is not allocated enough memory on the server you're on. Either upgrade to a better server or try using the compress feed configuration option. And if compressing still doesn't work and you can't/don't want to get a better server, you will likely have to select the configuration option to start and stop the feed at a certain number. So start at 0 and stop at 2000, then redo it for 2001 to 4000. Or whatever number you need to be able to get it to not time out. I use the commercial version so I am not sure what settings are/aren't available in the free one, so my suggestions might be moot.


Zen Cart and it's community are the best!!

27 Jul 2017, 1:01 AM
#332
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

YarnCharm:

I just recently upgraded to 1.5.5e fresh install and added Merchant Center Feeder 1.14.5.
I immediately encountered a problem with Google reporting the following two errors:
"Unsupported currency in attribute: price" and "Missing required attribute: price"

On inspection of the xml output file, I found the following elements (as example) in each item:

<g:price>8.80</g:price>
<g:currency>USD</g:currency>

> 
> Then checking Google's help on the product data attributes for price:  [https://support.google.com/merchants/answer/6324371](https://support.google.com/merchants/answer/6324371)
> I came to the conclusion that it looks like for xml, that the currency should really be included within the price attribute.
> 
> I made the following changes to resolve it at line 380 and line 431 in googlefroogle.php :
> line 380 changed from:
> ```php
$item->appendChild($dom->createElement('g:price', number_format($variants_price, 2, '.', '')));

to:

$item->appendChild($dom->createElement('g:price', number_format($variants_price, 2, '.', '') . ' ' . GOOGLE_PRODUCTS_CURRENCY));

> and
> line 431 change from
> ```php
$shipping->appendChild($dom->createElement('g:price', (float)$shipping_rate));

to:

$shipping->appendChild($dom->createElement('g:price', (float)$shipping_rate . ' ' . GOOGLE_PRODUCTS_CURRENCY));

> 
> And I made changes similarly at lines 302 and 350 in google_base.php.
> 
> I also ended up setting "Show Default Currency" to false in the Google Merchant Center Feed configuration to turn off the <g:currency> field that doesn't seem to be parsing anyway (but it also eliminated the ¤cy=USD from the URL which is unnecessary on our site, that may not be the case for others.) 
> 
> In case anyone ran into the same thing, that seems to have taken care of the issue for me.

that is very curious and interesting.... at least to me... when i look at a clients feed here:

<https://lawineco.com/feed/lawc_products_en.xml>

i have the price and currency set to separate fields and google does not complain about it.

the link that you provided certainly would indicate to add the currency into the price element. i have my clients feed set to US Dollar, however i did not see a setting for "Show Default Currency".

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

27 Jul 2017, 2:45 AM
#333
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Thank you this worked

27 Jul 2017, 3:33 AM
#334
yarncharm avatar

yarncharm

New Zenner

Join Date:
Mar 2011
Posts:
20
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Amethyst_fairy:

Unfortunately still having trouble getting a feed. Have tried to inc memory etc. [26-Jul-2017 14:14:13

America/Chicago] PHP Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, boolean given in /home1/thedrah1/public_html/includes/classes/google_base.php:389

Have you made any modifications to google_base.php? Assuming you're on 1.14.5 of the merchant feeder plug-in, that first line looks like an argument problem coming from a calculated expiration date function that really shouldn't have too much of a problem? What version zen cart and google merchant center are you on?

30 Jul 2017, 5:50 AM
#335
yarncharm avatar

yarncharm

New Zenner

Join Date:
Mar 2011
Posts:
20
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

carlwhat:

i have the price and currency set to separate fields and google does not complain about it.

the link that you provided certainly would indicate to add the currency into the price element. i have my clients feed set to US Dollar, however i did not see a setting for "Show Default Currency".

That is really interesting, and I'm not sure why merchant product feed wouldn't take the separate fields in mine but yours still works.

I did notice when setting up this new account, that it mentioned something about new accounts getting the "new Product feed experience" as of July 24th or something similar to that. So it could be a change rolled out only for new accounts so far, so it is possible changes might be coming for older accounts.

Also, in case you are still looking for it, the setting for "Show Default Curency" is in the Admin control panel under "Configuration" then "Google Merchant Center Feeder Configuration". I set mine to false once I added the currency to the price field.

Cheers.

30 Jul 2017, 12:03 PM
#336
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Hi,
I don't think made any changes to google base. The only changes have made to files have been the preg_split and changed to explode. It worked when decreased number of products. Unsure after this error if I did a clean install of the feeder I may have. Just ran to see here is my errir log.
[30-Jul-2017 06:58:54 America/Chicago] Request URI: /googlefroogle.php?feed=fy_un_tp&limit=&offset=&x=48&y=8&key=1ea3bb8da8, IP address: 24.34.85.238
#1 trigger_error() called at [/home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home1/thedrah1/public_html/includes/classes/google_base.php:799]
#5 google_base->google_get_products_special_price() called at [/home1/thedrah1/public_html/includes/classes/google_base.php:730]
#6 google_base->google_get_products_actual_price() called at [/home1/thedrah1/public_html/googlefroogle.php:187]

[30-Jul-2017 06:58:54 America/Chicago] PHP Fatal error: 2008:MySQL client ran out of memory :: select specials_new_products_price from zen_specials where products_id = '23416' and status='1' ==> (as called by) /home1/thedrah1/public_html/includes/classes/google_base.php on line 799 <== in /home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php on line 167
[30-Jul-2017 06:58:54 America/Chicago] PHP Fatal error: 2013:Lost connection to MySQL server during query :: select count(*) as total
from zen_sessions
where sesskey = '630nsedq5p3l2mllnn02dk9uj4' ==> (as called by) /home1/thedrah1/public_html/includes/functions/sessions.php on line 66 <== in /home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php on line 167

On version 1.55e. Too many plug ins to count.
Thanks
Sandria

30 Jul 2017, 5:32 PM
#337
yarncharm avatar

yarncharm

New Zenner

Join Date:
Mar 2011
Posts:
20
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Amethyst_fairy:

It worked when decreased number of products.
Then it probably is back to a memory limit of some sort.

I think you said you increased the Memory Limit from 128M to 256M (under Configuration...Google Merchant Center Feeder Configuration...Memory Limit). Did that let you increase the number of products, i.e. did you test how many products you could get through at 128M and then at 256M? Did it make a difference at all?

It may also due to host limitations. If you look under Tools...Server Information, what is your PHP Memory Limit?

Here's an example of mine:

Server Information
Server Host: xxx.xxxxxhost.com (xxx.xxx.xxx.xxx) Server OS: Linux 2.6.32-696.299.3.2.cp6.x86_64
Server Date: 07/30/2017 13:22:30 Server Up Time: 13:22:30 up 38 days, 10:27, 0 users, load average: 2.35, 2.65, 2.71
HTTP Server: Apache PHP Version: 5.6.30 (Zend: 2.6.0)
PHP File Uploads: On Upload Max Size: 64M
PHP Memory Limit: 160M POST Max Size: 64M
Database: MySQL 5.5.55-cll Database Host: localhost (127.0.0.1)
Database Date: 07/30/2017 13:22:30 Database Data Size: 48,274 kB
Database Index Size: 10,354 kB MySQL Slow Query Log Status: On
MySQL Slow Query Log File: /var/lib/mysql/xxxx-slow.log MySQL Mode: (None set)

3 Aug 2017, 11:09 AM
#338
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

I installed new update just to be safe still same problem. Have inc memory in both php configuration and google merchant configuration. Actually inc to 512M. The most O get extra is a couple hundred products with each. Even tried turning on jss/css minfy as someone recommended earlier in forum but at most couple 100.

Thanks
Sandria

Server Information
Server Host: Server OS: Linux 3.12.74-20170619.148.ELK6.x86_64 Server Date: 08/03/2017 06:05:17 Server Up Time: 06:05:17 up 42 days, 6:09, 1 user, load average: 5.93, 4.70, 4.99HTTP Server: ApachePHP Version: 7.0.12 (Zend: 3.0.0)PHP File Uploads: OnUpload Max Size: 64MPHP Memory Limit: 512MPOST Max Size: 64MDatabase: MySQL 5.6.32-78.1-logDatabase Host: localhost (127.0.0.1)Database Date: 08/03/2017 06:05:17Database Data Size: 24,529 kBDatabase Index Size: 5,513 kBMySQL Slow Query Log Status: OnMySQL Slow Query Log File: /var/log/slow-queries.logMySQL Mode: NO_ENGINE_SUBSTITUTION

3 Aug 2017, 6:59 PM
#339
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

The error says "MySQL client ran out of memory". Not "PHP ran out". Changing PHP memory limits probably isn't going to help that. May need to optimize the SQL query to avoid wasting MySQL memory.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Aug 2017, 7:36 PM
#340
yarncharm avatar

yarncharm

New Zenner

Join Date:
Mar 2011
Posts:
20
Plugin Contributions:
0

Re: Google Merchant Center Feeder for ZC v1.5.x [Support Thread]

Amethyst_fairy:

...but at most couple 100.

I can pull over 3000 products in the feed and haven't reached any memory limits of any sort yet. DrByte also has a big point there about it being a MySQL limit getting reached in this case, not reaching a PHP memory limit.

I suspect there's something else seriously amiss here - glancing back it seems like each of the error logs you've posted shows it breaking at different points. If you've checked your database for corruption, then maybe the next step I'd suggest is doing some testing in a clean copy of your same version of zen cart and google merchant feeder in a test environment somewhere else on your same server, with a clean test database, and then import some of your products, attributes, etc from your live database to test with. If it can generate a feed from a clean starting point, then start incorporating all those plug-ins that you had said are too many to list, and see when it breaks in your test environment. Good luck!