Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically send data feed to Froogle


gottaloveit

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

 

 

Link to comment
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

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
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.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
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.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
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.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 11 months later...

@Jack_mcs, I am looking to install module which can comply with Google Merchant Centre (GMC) Requirement for Google Free Products Listings. I noticed from your comments in another forum that this may be the best module to achieve this or is there any other?

Please advise if This module can work with GMC and if  it is compatible to work with Phoenix 1.07.12.

It seems like Google can fetch feeds automatically and there is no mention of Google FTP User name/ password as required in googlefeeder.php

I tried installing it for testing and received following errors: No warning comes if I stop errors reporting in admin/config.php.

Notice: Undefined variable: currentVersion in /homepages/31/dxxxxxxxxx/htdocs/xxxxxxxxx/admin/feeders.php on line 52

image.png.3f84de6ff250f4c8019f197c3ea3b1d2.png

Any suggestion pls.Thanks

Link to comment
Share on other sites

@zeeshopYes, it works with google. I don't know if it will work with the latest Phoenix version but I think it should. The error is because you didn't upload the Version Checker files (see the installation instructions).

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks, I uploaded the feed on GMC  but feed was rejected due to following reason:

image.png.d32c8228529912e9c4a430b76aec3e19.png

GMC requires price in this format: image.png.9bd9342b51b28d06b99dcc39db938eda.png

 

I changed the lines as advised in 2019 post on 17/07/19 shown below, but it is showing currency as USD in feed file, but my store default currency is GBP, is there any way to change currency to GBP.

 

Since GMC requires the price field to have the curency specified (i.e. '19.99 USD'), near line 465 I replaced 

$row->price . "\t" .
with

$row->price . ' ' . OPTIONS_CURRENCY . "\t" .

Thanks

image.png

Link to comment
Share on other sites

5 hours ago, zeeshop said:

currency as USD in feed file, but my store default currency is GBP,

Please try changing the currency setting in the googlefeeder.php file.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 1 month later...

@Jack_mcs, I am noticing on my feed that after 587 product, google feed tsv file is splitting product details in two rows, and on excel/ google sheet display it is not on a relevant column. which I suspect will give error on Google.

image.thumb.png.b20d01cab43645a8f4f3ae5da247b897.png

image.png.cbcbf540ec7f401be05f156d5893058e.png

Is this issue caused due to server memory issue, as I am trying to produce feed for over 3000 products. Does this effect the outcome.

do you recommend any solution for this please.

Thanks

image.png

Link to comment
Share on other sites

@zeeshopTrying to handle that many products can cause the script to fail, depending on the server. The split upload option can be used if it is. But when that causes a failure, the feed doesn't complete, which it sounds like it is in your case. I think it might be some character in the product that is confusing the code. Trying adding the ID of the failing product to the skip product ID list and see if the feed goes farther.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

1 hour ago, Jack_mcs said:

The split upload option can be used if it is.

Thanks, is there a split file option available in googlefeeder.php file, I am unable to find it.

Thinking of using EasyPopulate to download google compatible feed, it downloads all products but layout is not compatible.

Link to comment
Share on other sites

10 hours ago, zeeshop said:

is there a split file option available in googlefeeder.php file,

No, there isn't I apologize for the mistake. I was thinking of Easy Populate. For this addon, there shouldn't be any reason it would fail with that many products when ran as a cron job. It might timeout if ran via admin, depending upon your hosting accounts timeout limit. So try running it as a cron  job to see if it completes.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

On 2/22/2021 at 2:46 AM, Jack_mcs said:

So try running it as a cron  job to see if it completes.

Thanks, I tried running cron job with same result.

I used IONOS Cron Job Manager to do the job, which basically run this page: https://www.site.com/admin/googlefeeder.php?noftp=1 

==================================

Ok, I found the problem, this whole issue was caused due to <"> added at the end of HTML code in description. As soon I changed it, all worked properly. 

Thanks for your support @Jack_mcs

Link to comment
Share on other sites

  • 3 weeks later...
On 2/21/2021 at 2:40 PM, Jack_mcs said:
@zeeshopTrying to handle that many products can cause the script to fail, depending on the server. The split upload option can be used if it is. But when that causes a failure, the feed doesn't complete, which it sounds like it is in your case. I think it might be some character in the product that is confusing the code. Trying adding the ID of the failing product to the skip product ID list and see if the feed goes farther.
 
 
Ok, this line break problem in google feed was ongoing, I tried several ways to solve the issue, such as deleting items, changing description etc. 
 
But now what I established is that, as I uploaded hundreds of product using easy populate, some how new products I am trying to upload is cause this issue and starting to break line as below in google feed:
image.thumb.png.ee880a67cc8b1b410134cffc28fa4c76.png
 
Strangely enough when ever I go in Admin side catalogue, all I had to do , open the product and click save, afterward when I generated Google feed, this particular product issue is solved and comes in one line. As I have thousands of products, and opening and closing (by saving) product will take ages.
 
I have no clue what is the reason for this, and how by only opening/ closing making product to display properly in feed, perhaps something to do with the newer version of Easy populate, which may require some minor change.
 
===============
 
Easy populate, google shopping function seems to bring all products the way I want, but SEO function is not working there, if SEO function can work in easy populate, then my google feed issue will be resolved.
 
Any support will be very much appreciated.
 
Many thanks
 
Link to comment
Share on other sites

It seems the problem would have to be in the description of the product that is failing since, as I understand it, not all products are failing. So if that is the case, all I can suggest is that you try to isolate the part of the description that is causing the problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The only additional required field for a local feed is the store code, as far as I know. To add that, find this line

$output = "link

and change it to 

$output = "store code\link

Then find

      $output .=
      preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" .

and change it to

      $output .=
      "my store\t" .
      preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" .

You have to replace "my store" with your store identifier, which has to match what you use in setting of the feed in your google account. You may also have to adjust some of the other settings in the file. 

The above hasn't been tested.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...

@PapancoIn the googlefeeder.php file, change the OPTIONS_ENABLED_GOOGLE_UTM setting  to 0 or 1, depending on if you are using that google option.. Then find this line

define('OPTIONS_GOOGLE_UTM', '?utm_source=GoogleBase1&utm_medium=BaseFeed1&utm_campaign=products'); //see http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55578

and replace it with this

if (OPTIONS_ENABLED_GOOGLE_UTM == 0) {
   define('OPTIONS_GOOGLE_UTM', '?store={my_store_code}'); 
} else {
   define('OPTIONS_GOOGLE_UTM', '?store={my_store_code}&utm_source=GoogleBase1&utm_medium=BaseFeed1&utm_campaign=products'); //see http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55578
}

As before, be sure to change the "my_store_cde" with yours.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...