Jump to content
gottaloveit

Automatically send data feed to Froogle

Recommended Posts

Hi Jack,

sorry, I may misunderstand you, but there is an option 3.

line 402 does what I need;

 if (OPTIONS_ENABLED_INCLUDE_TAX == 3) {

Option 2 says 

define('OPTIONS_TAX_CALC', (OPTIONS_ENABLED_INCLUDE_TAX == 2 ? (OPTIONS_TAX_RATE/100) + 1 : '1')); //UK. US tax rate - US is ignorded since it is 1

so maybe you meant:

if(OPTIONS_ENABLED_INCLUDE_TAX == 1 || OPTIONS_ENABLED_INCLUDE_TAX == 2) $output .= "\ttax";

Best regards

Christoph

Share this post


Link to post
Share on other sites

There's nowhere to set it to 3, unless one doesn't following the instructions. The instructions say to set it to 0, 1, or 2 but the code checks for 3. See this

define('OPTIONS_ENABLED_INCLUDE_TAX', 0);       //0 = no tax, 1 = uses google method, 2 = UK Vat

 

Share this post


Link to post
Share on other sites

Well whatever, I have to set it to 3 because without it no tax calculation (with differing taxes for e.g. food) would be done. 

There is an option which is checked for, but it does not exist?

By the way my middle name is PIA since now, I guess. :wink:

Best regards

Christoph

Share this post


Link to post
Share on other sites

Hello,  How can i edit the following to get the Image_Link url to pull from the 1st Large Image vs the Main Image which is only the smaller thumbnail? 

in googlefeeder.php   believed i needed to change this line

CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url,

 to 

CONCAT( '" . $imageURL . "' ,products_images) AS image_url,

But the above didn't work.  products_images is it's own table not a sub of the products line the thumbnails, so may need edit elsewhere ?  

Thanks,
Tiffany  (BS Edge)

Share this post


Link to post
Share on other sites

I'm  not sure I understand but if you are saying your image name is not stored in the products table then that is a non-standard setup and I won't be able to help you here.

Share this post


Link to post
Share on other sites
4 hours ago, Jack_mcs said:

I'm  not sure I understand but if you are saying your image name is not stored in the products table then that is a non-standard setup and I won't be able to help you here.

It's a standard BS Edge setup/table - apologizes i'm probably not using the correct terminology - the right image is currently where the code pulls the image url  Products>Products_image, however this is just the thumbnail image.  The left is where the first of the larger images are stored i'd like to use as the url  Product_Images > Image.  

image.png.8b53d091a19b97862f6badbc40cbed3b.pngimage.png.8e359b689d8833c2d5f9c80d97e11b4c.png     

Share this post


Link to post
Share on other sites

OK, I understand. You can try this. It might work though I'm not sure how it will handle more than one additional image.

Find

CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url,

and change it to

CONCAT( '" . $imageURL . "' ,products_images.products_image) AS image_url,

A few lines down, find

products,

and add this after it

products_images,

and find

WHERE products.products_id=products_description.products_id 

and add beneath it

AND products.products_id=products_images.products_id

Good luck. :)

Share this post


Link to post
Share on other sites

Awesome!  Thanks so much @Jack_mcs  That worked.   

one minor change from above  "products_images.products_image"  to "products_images.image"  and it's pulling the first image URL if multiple exist and that's exactly what I wanted. 

Thanks again.  :-) 

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

  • Added the OPTIONS_USE_IMAGE_TABLE to cause the image to be loaded from the products_image table (2.3 only).
  • Changed the condition field to be loaded from the products description table instead of the products table. Found by member kru.
  • Changed the code to limit the length of the title to 150 characters.
  • Changed the code that handles the taxes. An invorrect value caused VAT to be ignored.
  • Removed filename definitions.

 

Share this post


Link to post
Share on other sites

Is this compatible with 2.3.4.1 CE?

I installed it a short time ago, but when I click on Create and DO NOT upload a Googlebase datafeed...

It opens a new tab in the browser that reads:

https://mysite.com/googlefeeder.php?noftp=1

But it's just a white screen.  Nothing happens.  Nothing in my new Feeds folder.

- Andrea

Share this post


Link to post
Share on other sites

Yes, It is. Many times it is because the code can't figure out which database handler is running. To see if that is the problem, change this line in the googlefeeder.php file

$myfetch_mysql = ($use_mysqli ? mysqli_fetch_object : mysql_fetch_object);
 

to

$myfetch_mysql = mysqli_fetch_object;

If that doesn't work, then change it to

$myfetch_mysql = mysql_fetch_object;

If that doesn't fix it, you need to find out what the error is. after the line near the top that has application_top.php in it, add the following and then run the script to see if it shows the error.

  error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_DEPRECATED);
  ini_set('display_errors','1');

 

Share this post


Link to post
Share on other sites

Hi Jack,

All three ways continue to give me nothing but a white screen. 

Don't know if it means anything or not, but I'm also getting a warning on the feeders.php screen in bold red text about not having Version Checker installed.

Yet, I do.  This installation is only weeks old.  ???

- Andrea

Share this post


Link to post
Share on other sites

I don't recall if that will cause a failure or not. But it is just an upload to install Version Checker so I suggest trying that first.

Share this post


Link to post
Share on other sites

I installed version checker via the link you gave me.

I don't quite understand what that 'other' version checker link is my Admin/Tools area because all of the files included with the one you gave me are totally new to my system.  ???

Admin/Includes/Functions/version_checker.php is a new file for me

So is Admin/Includes/Languages/English/version_checker.php

Anyway...it's still not working.  Will comb thru the settings again and see if I've missed something.

- Andrea

 

Share this post


Link to post
Share on other sites

What you just installed is my Version Checker addon that I wrote years ago as a way for shop owners to check for new updates on my addons, or of any addon that installed it. The idea of it was adopted into the 2.3 version at some point but the two are totally separate. The one that was in your shop will check for updates to the oscommerce version you are using.

As for the problem, if I understand you correctly, changing the error reporting line didn't cause anything to display. If that is correct and if your host uses a control panel that records errors (cpanel does) then you can view the error there. Without knowing what the error is, it is difficult to troubleshoot. Although a common reason for a white screen is a missing file or one in the wrong location.

Share this post


Link to post
Share on other sites

I've tried everything imaginable and still cannot get this working.

Had it for years in my old 2.2 site and it's such a simple, little contrib to install, very frustrated now.

When I run it in Firefox, I just get a white screen.

When I run it in Chrome, I get:  This page isn't working.  Yoursite.com is currently unable to handle this request.  HTTP Error 500

This is a new install (a month old) of 2.3.4.1 CE with PHP 7.0 and MySQL 5.6.39

Any ideas? 

- Andrea

 

Share this post


Link to post
Share on other sites

I just installed it into a test shop running 7.1 and it ran fine. There were some warnings that should be fixed but they didn't stop the feed from being created. A white screen and a 500 error means there is some fatal error occurring. Since the script runs fine for me I have to think it is a problem with your installation. Does It fail if you load the script directly, like https://your site.com/admin/googlefeeder.php

 

If that fails, try uploading the file after renaming it and then access it directly, like https://your site.com/admin/googlefeeder_test.php

If it still fails, you will need to determine what the error is.

Share this post


Link to post
Share on other sites

If I try to access it directly, shouldn't I be prompted to log in to Admin? 

It's not.  So...I'm wondering if that means anything. 

- Andrea

Share this post


Link to post
Share on other sites

How about this?  Finally found something:

[27-Jun-2018 18:11:35 America/New_York] PHP Warning:  require(includes/classes/logger.php): failed to open stream: No such file or directory in /home/xxxxx/public_html/admin/includes/application_top.php on line 83

Line 83 in application top reads:

// initialize the logger class
  require('includes/classes/logger.php');

But, I DO have logger.php in the catalog/admin/includes/classes folder.  Looks like this:

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  class logger {
    var $timer_start, $timer_stop, $timer_total;

// class constructor
    function __construct() {
      $this->timer_start();
    }

    function timer_start() {
      if (defined("PAGE_PARSE_START_TIME")) {
        $this->timer_start = PAGE_PARSE_START_TIME;
      } else {
        $this->timer_start = microtime();
      }
    }

    function timer_stop($display = 'false') {
      $this->timer_stop = microtime();

      $time_start = explode(' ', $this->timer_start);
      $time_end = explode(' ', $this->timer_stop);

      $this->timer_total = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);

      $this->write(getenv('REQUEST_URI'), $this->timer_total . 's');

      if ($display == 'true') {
        return $this->timer_display();
      }
    }

    function timer_display() {
      return '<span class="smallText">Parse Time: ' . $this->timer_total . 's</span>';
    }

    function write($message, $type) {
      error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' [' . $type . '] ' . $message . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
  }
?>

Now I'm stuck. 

- Andrea

Share this post


Link to post
Share on other sites
3 hours ago, puggybelle said:

If I try to access it directly, shouldn't I be prompted to log in to Admin?

Yes. You need to login first and then click in the url box and change it.

I think the problem is that your admin is not a directory in your shop. The script is ran in admin but switches to use the shops files and assumes the shop is one level up. If it isn't, it will fail. To fix that, in the googlefeeder.php file, change this line

chdir('../');

to this

chdir('/home/your user name/public_html/');

Be sure to replace "your user name" with the actual username and add the directory the shop is in after the public_html/. You need to adjust the whole line to match your site. You can find the correct path in the document_root string in the includes/configure.php file.

Share this post


Link to post
Share on other sites

define('DIR_FS_DOCUMENT_ROOT', '/home/xxxxxx/public_html/');

I changed the googlefeeder.php file to:

chdir('/home/xxxxxx/public_html/');

Still won't run.  Shop is in the root folder.

- Andrea

Share this post


Link to post
Share on other sites

The logger.php file is not part of this addon or a core file. From what you posted, it is in the admin directory. But the google script runs using the shops directory. That shouldn't be a problem normally but I suspect, from the name of that file, that it is trying to track things and it can't be found when the script changes locations. All I can suggest is that you copy that file to the shops classes directory. As long as it doesn't fail on any dependencies, it should work.

Share this post


Link to post
Share on other sites

It is a core file with the install of osC 2.3.4.1 CE

Otherwise, I wouldn't have it.

Admin/Includes/Classes/logger.php

logger.PNG.bb7cf7993f51b7b9cc4cea9ab3d3057c.PNG

It's very late now.  I'll try what you suggested tomorrow.  Thanks for your help!

- Andrea

Share this post


Link to post
Share on other sites

You're right. I was looking in the shops directory. I apologize for the confusion.

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

×