Jump to content
gottaloveit

Automatically send data feed to Froogle

Recommended Posts

Yep that fixed it Jack. Thanks.

I remember changing to mysqli from mysql many years ago to get bit to work on PHP5, I assumed that would be OK for PHP7 but I take it 7 is more fussy.

The last error I am getting is:

'PHP Warning: count(): Parameter must be an array or an object that implements Countable.'

This is on the following code. (top line) and also on a similar bit of codebelow using  (count($statsArray['qty']) > 0) {

if (count($statsArray['price']) > 0) {
  $warning = true;
  echo '<p style="margin:auto; text-align:left;  padding:10px; 0px">';
  printf( "***Warning:*** There are %d products with a price of $0.<br>", $statsArray['price'] );

  for ($i = 0; $i < count($statsArrayPrice); ++$i) {
      echo  '&nbsp;&nbsp;&nbsp;' . $i . ' - ' . $statsArrayPrice[$i] .'<br>';
  }

  echo '</p>';
}

I changed $statsArray['price'] to $statsArrayPrice and it seems to work OK and report all zero quantity items and not error out. I hope this is correct.

Otherwise all the code can be ported to Phoenix with minimal changes. Only had to hard code includes directory etc..

 

 

Share this post


Link to post
Share on other sites

@yahalimuThe following changes should be made. Please try it and let me know if there are any other issues.

Find

if (count($statsArray['price']) > 0) {

and replace it with

if (is_array($statsArray['price']) && count($statsArray['price']) > 0) {

Find

if (count($statsArray['qty']) > 0) {

and replace it with

if (is_array($statsArray['qty']) && count($statsArray['qty']) > 0) {

edited: corrected typo for first change.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

Hi Jack,

That latest code adjustment did not error but also did not list zero quantitiy or zero price products in my installation.

Iain

 

Share this post


Link to post
Share on other sites

From my previous post, the lines should be changed to

if ($statsArray['price'] > 0) {

and

if ($statsArray['qty'] > 0) {

There will be warning notices if error reporting is enabled. I will upload a new version soon that should fix all of the known issues.

Share this post


Link to post
Share on other sites

Google warnings not going away

Error is Mismatched [price] (page crawl)

This comes in pricing showing excl Tax on site, the googlefeeder.txt is calculated including Tax
Google bot is crawling site excluding Tax
Google reports Mismatched [price]

Web is setup to show pricing excluding tax in admin with tax rates 0% and 15%

What needs to be done?


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites

Regarding the warnings, I will try to get an updated version uploaded soon.

Regarding the tax, I have clients that have shops that use tax and others that don't. But they are using the later version, which has not been released, so that might be the reason.

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

  • Added gtin as an identifier.
  • Added code for Phoenix compatibility. Installation just requires the files to be uploaded for Phoenix.
  • Changed count code to pass php 7.3. Found by member @yahalimu.
  • Changed default http to https in the googlefeeder file.
  • Removed the code to check if mysql is being used. Mysqli is now required.

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

×