Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically send data feed to Froogle


gottaloveit

Recommended Posts

 PHP Warning:  require(includes/functions/localization.php): failed to open stream: No such file or directory in /home/xxxxxx/public_html/admin/includes/application_top.php on line 191

Line 191 application_top.php: // define our localization functions
  require('includes/functions/localization.php');

This is all happening because my site is in the root folder? 

I mean, I can't possibly be the only person who installed their site in the root.

I never could foresee a problem like this happening.  Install it in the root, install it in a new folder, who cares?

So I installed the site in the root.

Is this just a problem with the Googlefeeder script?  I've installed other contribs and had no problems. 

There's a ton more includes/this/that under the one that threw the error in application_top.  I expect they're all going to blow, one after the other..

- Andrea

Link to comment
Share on other sites

I never said there was a problem with having the site in the root. That is actually my preferred location. The problem I was mentioning is about the location of the admin. A standard installation will have this setup:

/root/shop/  for the shop

/root/shop/admin/ for the admin

But you could have

/root/shop/  for the shop

/root/admin/ for the admin

If you have the first setup, then the addon should work as is. If you have the second, you may need to change the line mentioned previously.  Since the error is showing the application_top file being used is from the admin, it would seem to indicate that the change directory command is not working on your server. I don't know why that might be since that has been a standard function since php V 4.  I don't know what else to suggest. No one else has had such a problem that I am aware of so it seems to be a problem with your shop. But there's no way for me to know what that is without troubleshooting it.

 

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

Hello Jack,

I contacted my webhost with this one and they come back with chdir is functioning fine on the server.  No help there, really.

So...I did this:

I made a copy of the public_html/includes/application_top.php file

Renamed it application_top_feed.php

Put it in the Admin folder (since I can't get the script to pull from public_html)

Changed the include application_top.php call at the top of the googlefeeder file to include application_top_feed.php

And it works.

I have a nice, big 6,000+ product feed in my public_html/feeds folder now.

My question is:  are there other stock files in osCommerce that use this chdir function to run? 

I'm wondering if it's just this one, the Googlefeeder, or could I have trouble lurking in other files and just don't know it?

- Andrea

Link to comment
Share on other sites

Congratulations on your fix. It's not an ideal solution but if it works...

As for chdir, yes, it is used quite a bit, in both core and addon files. See /ext/modules/payment/paypal/express.php

So while your kludge worked, it is covering up a serious problem in your site or on the server, regardless of what your host says. It is the kind of thing that will cause strange problems and be almost impossible to troubleshoot. I suggest you find the cause.

To help troubleshoot it, place this before and after the chdir command and then run the script. It should display the path with the admin in it and then the path without the admin. If that is not the case, you can show that to your host as proof that it isn't working. 

echo getcwd();

 

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

When I run the Googlefeeder file again with that code inserted, I get this:

/home/username/public_html/admin/home/username/public_html

Is that what it should be? 

- Andrea

Link to comment
Share on other sites

It should be on two lines, not one. Though that may be a browser issue. Also, I'm assuming your shops username is not username but if it is, that could be 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

I'm just using username as an example of what should be there.  It is displaying the correct username when I run it.

Firefox, Chrome and IE are all coming back with the results on one line.

Did I do this right?

echo getcwd();
chdir('/home/xxxxxx/public_html');
echo getcwd();
include_once 'includes/application_top_feed.php';

- Andrea

Link to comment
Share on other sites

Then it is correct. I see I forgot to add a line break to the statement. So it looks like chdir is working. I can't offer any further support in a support thread for a specific problem so I guess you will have to stick with the fix you came up with.

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, Jack, I appreciate all of your help.

My 'fix' does the trick and the feed was accepted by Google, so...that's all that matters right now.

- Andrea

Link to comment
Share on other sites

  • 1 month later...
On 6/28/2018 at 12:50 AM, puggybelle said:

[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

Hello @Jack_mcs @puggybelle

I had the same problem and solved it by changing this line in googlefeeder.php

include_once 'includes/application_top.php';

to :

include_once './includes/application_top.php';

obviously do the same change in bingfeeder.php

This just forces the code to use the correct directory after the chdir('../');

Why, who knows???

This seems to apply to XAMPP servers (which is my test environment), my shop server doesn't need this change.

Regards

Mike

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

  • 2 months later...

I've been informed today that Google has a problem with one of my products and will suspend my account unless removed from the feed. What is the best way to remove or not include a product in the $sql query or resulting array? The specific product is a cannabis solid perfume.

The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

Link to comment
Share on other sites

  • 3 months later...

Hi,

I've been using v3.5 of this contribution for a long time now.  Thanks so much for putting it together.

Recently I noticed that occasional products were not being exported for some reason.

This is one such product:

   http://www.bestexhaust.com.au/store/lux-angel-eyes-p-19235.html

Here is the extract of the log:

   5731 - http://www.bestexhaust.com.au/store/corsa-polished-sport-back-with-black-tips-p-19231.html
   5732 - http://www.bestexhaust.com.au/store/capristo-porsche-9912-carbon-fibre-underbody-engine-cover-p-19233.html
   5733 - http://www.bestexhaust.com.au/store/capristo-competition-valve-system-p-19234.html
   5734 - http://www.bestexhaust.com.au/store/corsa-ford-mustang-2015-back-xtreme-black-tips-p-19236.html
   5735 - http://www.bestexhaust.com.au/store/corsa-ford-mustang-2015-back-xtreme-polished-tips-p-19237.html
 

As you can see it was missed after item #5733

Can someone suggest reasons why it would have been skipped?  Could it be a bug?

Oh, and before you ask I've checked this:

define('SKIP_CATEGORY_ID', '381,448'); //don't list any categories (or their products) listed here - separate each id by a comma
define('SKIP_PRODUCT_ID', ''); //don't list any products listed here - separate each id by a comma

It's not in either of those categories

Thanks

Mike

Edited by mglew
Link to comment
Share on other sites

4 hours ago, mglew said:

Oh as an experiment I changed the quantity from 4 to zero, and then it worked.  How do I make it work with stock >0?

It should be the other way around. There is a setting to ignore products if the quantity is less than 1.  If it were really failing like you say, none of your products would be in the feed, assuming they have a quantity.  It might be that you have that option set so when you change the quantity to 0 the failing product was ignored. If that is the case, I suggest creating a new product you can test with. Just enter a short name, price and quantity. Run the feed and make sure the new product shows up in it.  If it does, copy some of the things from the failing product, like its description, into the working one and run the feed again. Somewhere along the way the test product should fail.

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

Turned out the code works perfectly, its just I assumed that the text output on the screen was all products, but its just the products with zero stock.  Checked Google Merchant and the product is in there with the correct product_quantity and everything.

Thanks

 

Link to comment
Share on other sites

  • 1 month later...

Hello all,

I've been using this to upload our google feed for over 3 years.  Recently I had to change from VPS server to cloud server.  Now when I tried to update our google feed, all I'm getting is 500 ERROR message.  What do you think is causing not to work?

I have V 2.3.4 mini template shop with Googlebase ver. 3.3.

Thanks,

Don

Link to comment
Share on other sites

If it just fails with cron, then the cron job is not setup correctly, or maybe not at all. If it fails from a manual run, then it is due to something being different with the new server. Only your host can say what actually caused that error so you to ask them. 

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

@Jack_mcs

Hello Jack, I have installed this nice module and it looks very promising. Thanks.

My question is, I am getting a blank file with only the titles in it. (i.e. 

link	title	description	price	image_link	id	availability	age_group	brand	condition	expiration_date	google product category	gtin	identifier exists	adwords_labels	mpn	product_type	upc

 
I'm using osC v2.3.4. I tried debugging but can't find the problem comes from. I saw a post where you recommended replacing the line 
$myfetch_mysql = ($use_mysqli ? mysqli_fetch_object : mysql_fetch_object);
with 
$myfetch_mysql = mysqli_fetch_object;
 or 
$myfetch_mysql = mysql_fetch_object;
In my case the original line works same as mysqli_fetch_object, returning blank file with this output:


Feed contains 0 products.
File Completed: your-outfile.txt
Use the following for easier viewing from this page. It is still in development and not meant for anything other than viewing.
File Completed: your-outfile.csv
Script timer: 0.003809 seconds.

 
I am still looking through the pages on this topic to see if I can find the solution. Meanwhile, I would much appreciate your feedback on this. 

Thank you in advance.


Here are my settings:

define('SEO_ENABLED','true');    //Change to 'false' to disable if Ultimate SEO URLs is not installed
define('FEEDNAME', 'your-outfile.txt');       //from your googlebase account
define('DOMAIN_NAME', 'mysite.com'); //your correct domain name (don't include www unless it is used but do include the shops directory)
define('FTP_USERNAME', 'username'); //created from within your googlebase account
define('FTP_PASSWORD', 'password'); //created from within your googlebase account
define('CONVERT_CURRENCY', '0'); //set to 0 to disable - only needed if a feed in a difference currecny is required
define('CURRENCY_TYPE', 'USD');  //(eg. USD, EUR, GBP)
define('DEFAULT_LANGUAGE_ID', $languages_id);   //Change this to the id of your language if different than what is set as the default language in admin
define('QUOTES_CATEGORY_NAME',''); //if the Quotes contribution is installed, enter the name of the quotes category here
define('SKIP_CATEGORY_ID', ''); //don't list any categories (or their products) listed here - separate each id by a comma
define('SKIP_PRODUCT_ID', ''); //don't list any products listed here - separate each id by a comma

/*************** OPTIONS - IF ENABLED, ALSO SET THE SIMILAR OPTION FURTHER DOWN ******************/
define('OPTIONS_ENABLED', 1);
define('OPTIONS_ENABLED_AGE_GROUP', 1);
define('OPTIONS_ENABLED_ATTRIBUTES', 0);
define('OPTIONS_ENABLED_BRAND', 1);            //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', 1);              //if set, a database field named products_gtin must exist
define('OPTIONS_ENABLED_GOOGLE_PRODUCT_CATEGORY', 1); //http://www.google.com/support/merchants/bin/answer.py?answer=160081
define('OPTIONS_ENABLED_GOOGLE_UTM', 0);        // see 'OPTIONS_GOOGLE_UTM' below near line 72
define('OPTIONS_ENABLED_IDENTIFIER_EXISTS', 1); //set to 0 if required - https://support.google.com/merchants/answer/188494?hl=en
define('OPTIONS_ENABLED_ISBN', 0);              //if set, a database field named products_isbn must exist
define('OPTIONS_ENABLED_LABEL', 1);  
define('OPTIONS_ENABLED_MADE_IN', 0);
define('OPTIONS_ENABLED_MPN', 1);               //if set, see options for this setting below
define('OPTIONS_ENABLED_PRODUCT_MODEL', 0);     //displays the product model
define('OPTIONS_ENABLED_PRODUCT_TYPE', 1);
define('OPTIONS_ENABLED_SHIPPING', 0);
define('OPTIONS_ENABLED_INCLUDE_TAX', 0);       //0 = no tax, 1 = uses google method, 2 = UK Vat
define('OPTIONS_ENABLED_UPC', 1);               //if set, a database field named products_upc must exist
define('OPTIONS_ENABLED_WEIGHT', 0);

//some of the following only work if the matching option is enabled above.
define('OPTIONS_AGE_GROUP', 'Kids'); // Adult or Kids

define('OPTIONS_AVAILABILITY', 'quantity');     //"in stock" - Include this value if you are certain that it will ship (or be in-transit to the customer) in 3 business days or less.
                                                //"available for order" - Include this value if it will take 4 or more business days to ship it to the customer.
                                                //"out of stock" - You’re currently not accepting orders for this product.
                                                //preorder - You are taking orders for this product, but it’s not yet been released.
                                                //if empty (no entry), the data will be loaded from the database. A field in the products description table named products_availability is required
                                                //if "quantity," the field will be populated via the quantity: 0 or less = out of stock, greater than 0 = in stock
                                                //if "status," the field will be populated via the status field. in or out of stock

define('OPTIONS_BRAND', 'name');                //leave blank to load from the database field named products_brand, set to "name"  to substitute the products name, manu to substitute the manufactueres name or model to substitute the products model
define('OPTIONS_CONDITION', 'New');             //possible entries are New, Refurbished, Used or blank, which loads from the database field named products_condition
define('OPTIONS_CURRENCY', 'USD');
define('OPTIONS_CURRENCY_THOUSANDS_POINT', ','); //this is the thousands point as in $1,000.
define('OPTIONS_DATE_FORMAT', 'm-d-Y');         //change how the date is formatted
define('OPTIONS_FEED_LANGUAGE', 'en');
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
define('OPTIONS_GOOGLE_PRODUCT_CATEGORY', 'db');  //enter db to load from a database field named google_product_category enter or enter a specific google category - see taxomy - http://www.google.com/support/merchants/bin/answer.py?answer=160081
define('OPTIONS_GOOGLE_PRODUCT_CATEGORY_DEFAULT', '1253');  //enter the google category to be used if the database entry is empty 
define('OPTIONS_GTIN', '');
define('OPTIONS_ISBN', '');
define('OPTIONS_LABEL', '');
define('OPTIONS_MADE_IN', ''); // country code i.e. US - DEFAULT value was : define('OPTIONS_MADE_IN', 'US');
define('OPTIONS_MPN', 'model');  //leave blank to load from the database field named products_mpn, set to "name" to substitute the products name, manu to substitute the manufactueres name or model to substitute the products model
define('OPTIONS_PRODUCT_TYPE', ''); //full means the full category path (i.e., hardware,printers), anything else, or blank, means just the products category (i.e., printers)

//the following is for the shipping override option - enter multiple values separated by a comma
//Format entries follow. A colon must be present for each field, whether it is entered or not.
// COUNTRY - OPTIONAL - If country isn't included, we'll assume the shipping price applies to the target country of the item. If region isn't included, the shipping price will apply across the entire country.
// REGION  - OPTIONAL - blank for entire country, otherwise, us two-letter State (CA), full zip code (90210) or wildcard zip code (902*)
// SERVICE - OPTIONAL - The service class or delivery speed, i.e. ground
// PRICE   - REQUIRED - Fixed shipping price (assumes the same currency as the price attribute)
#define('OPTIONS_SHIPPING_STRING', 'US:FL:Ground:7.00'); //says charge shipping to US for residents of Florida at 5% and don't apply tax to shipping
define('OPTIONS_SHIPPING_STRING', ''); # the above line was the DEFAULT value

define('OPTIONS_TAX_RATE' , '10.25'); //default = 0 (e.g. for 20.0% tax use "$taxRate = 20.0;")  //only used in the next line
define('OPTIONS_TAX_CALC', (OPTIONS_ENABLED_INCLUDE_TAX == 2 ? (OPTIONS_TAX_RATE/100) + 1 : '1')); //UK. US tax rate - US is ignored since it is 1
//the following is for the tax override option - enter multiple values separated by a comma
//Format entries follow. A colon must be present for each field, whether it is entered or not.
// COUNTRY  - OPTIONAL - country the tax applies to - only US for now
// REGION   - OPTIONAL - blank for entire country, otherwise, us two-letter State (CA), full zip code (90210) or wildcard zip code (902*)
// TAX      - REQUIRED - default = 0 (e.g. for 5.76% tax use 5.76)
// SHIPPING - OPTIONAL - do you charge tax on shipping - choices are y or n
define('OPTIONS_TAX_STRING', 'US:FL:10.25:n'); //says charge tax to US for residents of California at 10.25% and don't apply tax to shipping

define('OPTIONS_UPC', '');
define('OPTIONS_USE_IMAGE_TABLE', '1'); //set to 1 to use the products_images table, which is only available in 2.3 shops
define('OPTIONS_WEIGHT_ACCEPTED_METHODS', 'lb'); //Valid units include lb, pound, oz, ounce, g, gram, kg, kilogram.

//the following allow skipping certain items
define('OPTIONS_IGNORE_PRODUCT_PRICE', 1);  //0 = include products with price of 0 in output, 1 = ignore products with price of 0
define('OPTIONS_IGNORE_PRODUCT_ZERO', 1);  //0 = include products with qty of 0 in output, 1 = ignore products with qty of 0

/*************** END MASTER SETTINGS ******************/
 


 
Edited by edo.script
Link to comment
Share on other sites

1 hour ago, edo.script said:

define('OPTIONS_GOOGLE_PRODUCT_CATEGORY', 'db');

This will cause a failure if you don't have the field mentioned in the database. Though from the output you show, that isn't the case. The output seems to show the script is working but just not finding any products. Do you have at least one active product? I know this may seem a silly question but if this is a new shop there may not have been any setup yet.

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

2 hours ago, edo.script said:

@Jack_mcs Thank you for the quick reply. The db setting is good since I have the field. Actually, I found the issue and I will post it here in case someone else has the same issue. I had changed the product_status field in DB from '1', '0' to 'a', 'i' (active - inactive respectively) and the 


if ( $row->prodStatus == '1' ) {

 

was not being tested. So I changed it to 

if ( $row->prodStatus == 'a' ) {

All is good now.

I just found it came back to post it here and saw your reply. I just finished reading your comment and noticed that you actually guessed it right too. "Do you have at least one active product?" :) 

Thanks a lot.

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