Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

The Feedmachine Solution


lech

Recommended Posts

Hi Rainer,

 

Thank you very much, that worked a treat.

 

How can I now get the price to show to only 2 decimal places? Some of the calculated prices are showing upto 6 decimal places at the moment - does this actually matter?

 

And one more thing... I entered the ftp server as "uploads.google.com" and my username and password from my merchant account but it doesn't work (can't connect to server error) - any ideas?

 

Cheers

 

Simon

Link to comment
Share on other sites

Hi Rainer,

 

Thank you very much, that worked a treat.

 

How can I now get the price to show to only 2 decimal places? Some of the calculated prices are showing upto 6 decimal places at the moment - does this actually matter?

 

And one more thing... I entered the ftp server as "uploads.google.com" and my username and password from my merchant account but it doesn't work (can't connect to server error) - any ideas?

 

Cheers

 

Simon

 

Hello again,

 

The decimals doesn't matter because they will be rounded to 2 decimals in google shopping.

 

About the ftp upload , I have the same problem and didn't get it to work neither.

I use the "Sheduled Upload" feature in the Google Merchant Center - Data Feeds, just where you define your feeds.

 

regards

Rainer

Link to comment
Share on other sites

  • 1 month later...

Whenever we try and "Generate and Upload Feeds Now" this is what we receive:

 

Google Product Search
------------
update status: feed updated as part of a force update
upload trigger status: feed upload triggered due to update
upload status:Could not connect to ftp server: uploads.google.com

 

Has anyone found a solution to this problem? Feedmachine is an awesome contribution. I would just like to get it to upload via ftp whenever changes are made to the product category like it is supposed to. I have Google uploading the file on a weekly basis but we still have to regenerate the file manually first. I know that is not a huge issue, but it is much more convenient if it does it automatically on update.

 

Again, thank you for an awesome contribution.

 

Any help is always greatly appreciated.

"Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!"

Link to comment
Share on other sites

Love the feedmachine, but I have a configuration issue.

 

I have another URL parameter that I have been using to track what particular item is being clicked to produce the click conversion.

I have been using another feed generator and had coded it to return the additional URL parameter of &utm_term="model number" where model number is pulled from the $products['products_model'] in the database. How can I structure or modify FM to return that parameter?

 

I have tried adding it to various locations in feedmachine.php where PRODUCTS_URL is generated, but it doesn't seem to be picking it up. I also tried creating a separate function in the configuration file, but it's not picking up the url parameters spec'd in the admin. Any help would be appreciated.

Link to comment
Share on other sites

  • 2 weeks later...

Google-base Shipping Attribute

 

Hi Rainer,

 

As Google now require the "shipping" attribute to be included in the feed do you have any plans for an update?

 

The problem is that we have numerous products with different weights and Google requires than shipping is shown for each country for each product in the feed.

 

I have only covered the UK at present which at least stops the error messages but for international orders it seem like it is going to be very long-winded to fix this properly.

 

I have added the following to google-product-search-us-en.php

 

'shipping' => array('output' => 'UK::Free Shipping:0 GBP,UK::Recorded Delivery: 0.89 GBP',

'type' => 'VALUE',

),

 

Can you suggest anything better?

 

Cheers

 

Simon

Edited by simonhornby
Link to comment
Share on other sites

  • 4 weeks later...

Google-base Shipping Attribute

 

Hi Rainer,

 

As Google now require the "shipping" attribute to be included in the feed do you have any plans for an update?

 

The problem is that we have numerous products with different weights and Google requires than shipping is shown for each country for each product in the feed.

 

I have only covered the UK at present which at least stops the error messages but for international orders it seem like it is going to be very long-winded to fix this properly.

 

I have added the following to google-product-search-us-en.php

 

'shipping' => array('output' => 'UK::Free Shipping:0 GBP,UK::Recorded Delivery: 0.89 GBP',

'type' => 'VALUE',

),

 

Can you suggest anything better?

 

Cheers

 

Simon

 

 

Hello,

 

It seems you use the weight based shipping cost of OSCommerce, so I do the same. As far as I know there is no way to extract the shipping cost information, as OSCommerce dosn't calculate the cost until an item is added to the shopping cart, at least.

At least my programming knowledge doesn't go far enough to do this.

The solution I use is to include the shipping weight tag in the google feed and set up a weight based shipping table in Google tax and shipping config.

This assigns a weight based shipping cost to each item, even it can't calculate real shipping costs for a purchase of several items.

 

Actually I'm working on an update which will include a solution for the new in US-feeds required gender, age group and color tags for apparel products.

 

Hope it will be ready for upload in a couple of weeks.

 

regards

Rainer

Link to comment
Share on other sites

  • 2 weeks later...

The new vesion: Google Product Search Feed 2.0 (Feedmachine Configuration) has been uploaded here:

 

http://addons.oscommerce.com/info/7130

 

In a standard OSCommerce instalation, there are no fields included to extract the following google feed tags:

 

- gender

- age_group

- color

- size

- material

- pattern

 

These tags are now required for apparel products in US and maybe in future in other countries too.

 

The fields can be individually activated in admin/configuration to show only on admin site (enough to be included in google feeds) or admin + catalog (product_info.php only).

 

There are alternative instructions to include fix values for all products of your shop, or category based values for the 'gender' and 'age_group' tags.

 

 

Hope this helps

Rainer

Link to comment
Share on other sites

  • 2 weeks later...

New version uploaded here:

 

http://addons.oscommerce.com/info/7130

 

Version 2.1 added:

color tag: - function added to read color values from product options

size - function added to read size values from product options

 

Includes caracter stripping, for example if reference numbering like 1-black, 2-white etc. is used.

 

regards

Rainer

Link to comment
Share on other sites

If someone can please & thank you help me I would so greatly appreciate it..

 

I have installed this great contribution but I seem to have one issue, when I go into my google account and do a test feed everything seems ok until the end where it says * error - feed file is in a format that we don't support: HTML

 

I don’t get how so I contacted google and advised them that the feed format does show google-product-search-feed-us-en.txt - they replied....

Please know that you have given correct extension to your data feed, however it is in HTML format. So questions is what did I not do correctly and or how can I change this to the correct file format for google, I have looked over the instructions and did a search for an answer but I cannot seem to find a solution to as what I have done incorrectly.

 

Thanks,

Lexi

Edited by Lexi
Link to comment
Share on other sites

If someone can please & thank you help me I would so greatly appreciate it..

 

I have installed this great contribution but I seem to have one issue, when I go into my google account and do a test feed everything seems ok until the end where it says * error - feed file is in a format that we don't support: HTML

 

I don’t get how so I contacted google and advised them that the feed format does show google-product-search-feed-us-en.txt - they replied....

Please know that you have given correct extension to your data feed, however it is in HTML format. So questions is what did I not do correctly and or how can I change this to the correct file format for google, I have looked over the instructions and did a search for an answer but I cannot seem to find a solution to as what I have done incorrectly.

 

Thanks,

Lexi

 

Hello,

 

The feed generated by this contribution is text format as you see by the extention ..h-feed-us-en.txt

First be shure you didn't change the file extension from: ..h-feed-us-en.txt to..h-feed-us-en.htm or ..h-feed-us-en.html

in line 17 of the configuration file:

'filename' => 'google-product-search-feed-us-en.txt',

 

If this is ok try this:

In Google Merchant Center, go to Data Feeds, then edit the configuration of your data feed, change: file format from "automatic detection" to "text".

Some terms may be different, I translated this from spanish version.

If this doesn't help, send me your feed configuration file and your data feed, I'll see what I can do.

 

My mail: [email protected]

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hi Rainer,

 

You are a genius if I could hug you I would - you really saved me on this as I was at my wits end trying to figure out what I could have done wrong. The feed was set correctly so I did what you suggested about going into the google merchant center and I changed it from automatic detection to text and that worked. It is a shame that google's own people didn't know enough to suggest that to me. So I did the upload and it worked like a charm but now I got some Item Warnings... - Rainer do happen to know what I could do to fix these by chance?

 

Thank You!

Lexi

 

1) Missing recommended attribute: brand (2908 warnings)

While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available. brand

 

2) Missing recommended attribute: google product category (2290 warnings)

While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available.

google product category

 

3) Unknown 'google product category' value(618 warnings, only affecting Product Search, Search API for Shopping)

The 'google product category' value must be a recognized product category in the content language or in English.

 

google product category Google > Category > Tree4

 

4) Missing recommended attribute: mpn(4 warnings)

While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available.

 

mpn

Edited by Lexi
Link to comment
Share on other sites

Hi Rainer,

 

You are a genius if I could hug you I would - you really saved me on this as I was at my wits end trying to figure out what I could have done wrong. The feed was set correctly so I did what you suggested about going into the google merchant center and I changed it from automatic detection to text and that worked. It is a shame that google's own people didn't know enough to suggest that to me. So I did the upload and it worked like a charm but now I got some Item Warnings... - Rainer do happen to know what I could do to fix these by chance?

 

Thank You!

Lexi

 

1) Missing recommended attribute: brand (2908 warnings)

While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available. brand

 

2) Missing recommended attribute: google product category (2290 warnings)

While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available.

google product category

 

3) Unknown 'google product category' value(618 warnings, only affecting Product Search, Search API for Shopping)

The 'google product category' value must be a recognized product category in the content language or in English.

 

google product category Google > Category > Tree4

 

4) Missing recommended attribute: mpn(4 warnings)

While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available.

 

mpn

 

Hello,

 

sorry but it seems you didn't adjust the configuration file for your needs.

Read the instructions for these tags where you get the errors.

 

regards

Rainer

Link to comment
Share on other sites

Hello,

 

sorry but it seems you didn't adjust the configuration file for your needs.

Read the instructions for these tags where you get the errors.

 

regards

Rainer

 

Hello again, I got a while to add some more concrete recomendations:

 

1.- for the brand tag:

 

It seems you don't use manufacturers in your shop.

See Step 4 in the instructions and use a fix brand for all products:

 

								   'brand'			=>   array('output' => 'My Own Brand', //Put here your proper Brand
																 'type' => 'VALUE',
																),

 

2.- for the google category tag, Missing recommended attribute: google product category:

 

It seems you didn't link ALL your shop categories to google categories.

 

See Step 6 in the instructions and add the links for the missing categories:

 

function FM_RS_google_categories_us_en($product) {
$output_field_category = ($product['parent_id'] > 0) ? $product['parent_id'] : $product['categories_id'];
return (($output_field_category == 1) ? 'Google > Category > Tree1' :
 (($output_field_category == 2) ? 'Google > Category > Tree2':
  (($output_field_category == 3) ? 'Google > Category > Tree3':
(($output_field_category == 4) ? 'Google > Category > Tree4':
 (($output_field_category == 5) ? 'Google > Category > Tree5':
  (($output_field_category == 6) ? 'Google > Category > Tree6':
   (($output_field_category == 7) ? 'Google > Category > Tree7':
	(($output_field_category == 8) ? 'Google > Category > Tree8':
	 (($output_field_category == 9) ? 'Google > Category > Tree9':
  (($output_field_category == 10) ? 'Google > Category > Tree10':
(($output_field_category == 11) ? 'Google > Category > Tree11':
 (($output_field_category == 12) ? 'Google > Category > Tree12':
  (($output_field_category == 13) ? 'Google > Category > Tree13':
   (($output_field_category == 14) ? 'Google > Category > Tree14':
	(($output_field_category == 15) ? 'Google > Category > Tree15':
	 (($output_field_category == 10000) ? '':
	  (($output_field_category == 10000) ? '':
(($output_field_category == 10000) ? '':
 (($output_field_category == 10000) ? '':
  (($output_field_category == 10000) ? '':
	 ''))))))))))))))))))));
}

 

 

3.- for the google category tag Unknown 'google product category' value:

 

In the lines you don't use leave the right side blank like here:

 

	 (($output_field_category == 12) ? '':

 

4) for the mpn tag, Missing recommended attribute: mpn(4 warnings):

 

it seems you didn't fill out the 'model' field for 4 products.

 

 

If you still get errors, please quote the code of your configuration file,

or mail it together with your feed file.

 

My mail: [email protected]

regards

Rainer

Link to comment
Share on other sites

  • 1 month later...

Hi all,

 

I've set up a cron job to run feedmachine_auto.php once a night at 11:30pm, and I know the cron is working because I also set it to email me upon completion, and the e-mails are coming through. The problem is that feedmachine_auto.php isn't updating or uploading any feeds. This is the result I get, it's the same whether the cron job runs it or I run it manually from the shell:

 

-----------------------
Feedmachine Report
-----------------------

start time: 2011-06-28 09:53:52 EDT
end time: 2011-06-28 09:53:52 EDT
runtime: 0.024120807647705


GLOBAL UPDATE TRIGGERS
----------------------
(no global update triggers)

NOTICES
-------
(no notices)

					F   E   E   D   S

Google Product Search
------------
update status: feed not updated(0)
upload trigger status: feed upload not triggered(0)
upload status: feed was not uploaded(0)

(etc. all other feed results are the same, not updated and not uploaded)

 

Any idea what's going wrong? I made sure that the appropriate folders have execute and write permissions where applicable, so I don't think that's it. I even tried commenting out the part in feedmachine_auto.php that refuses to update the feeds if there's a catalog update in progress, etc.:

 

//check to see if the catalog is currently being updated
/*$last_updated_date = max(array($global_current_info['products_last_updated']['value'], $global_current_info['specials_last_updated']['value'], $global_current_info['categories_last_updated']['value']));
if( $last_updated_date > (time()-FM_AUTO_GRACE_PERIOD_MINUTES*60) && $last_updated_date < (time()+FM_AUTO_GRACE_PERIOD_MINUTES*60) && !$force_update ) {
 echo 'Catalog is currently being updated: not generating or sending feeds.';
tep_exit();*/
}

Still no go. I can still manually update/upload the feeds in the Feedmachine admin section of my site, just not with feedmachine_auto.php. Thoughts?

 

Hi, I'm having same issue running a cron job. The cron job runs but the report says

update status: feed not updated(0)

upload trigger status: feed upload not triggered(0)

upload status: feed was not uploaded(0)

 

I have to upload manually for time being. What am I missing here? I'm running the version for Osc 2.2 which is v 5.03 it appears. Thanks!!

Link to comment
Share on other sites

My Currencies don't change, they always use my default county no matter what I change them to in Feedmachne. I have 4 countries set up.

 

Any ideas where I should look. I cannot find anything in the forums about this issue.

 

Steve

Link to comment
Share on other sites

  • 2 months later...

 

 

Hello,

 

There is one ")" missing in line 455 at the end with a huge amount of them.

 

regards

raiwa

I have an issue where I am not getting any errors, just not getting the goo Categories show up in the feed that is created or the id. Wonder if I am missing something, any help appreciated.

<?php
/*
* @[member='licensed2kill'] http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/*
Google Product feed configuration for The Feedmachine Solution
based on google-simple.php by: Lech Madrzyk
----------------------------
This configuration is complient with the Google-Feed specifications of march 2012.
It has to be used together with the modified feedmachine.php file which includes the 'IS_IN_STOCK' Keyword definition.
*/
$feed_config = array('name' => 'Google Product Search',
				 'authors' => 'raiwa',
				 'filename' => 'google-product-search-feed-us-en.txt', //change the name and the filename to a unique name for each language and country
				 'schema_version' => '2.0',
				 'fields' => array('id'			   =>   array('output' => 'FM_RS_product_id_us_en', //change the name to the name used for the function
																 'type' => 'FUNCTION'
															    ),
								   'title'		    =>   array('output' => 'products_name',
																 'type' => 'DB',
																 'options' => array('STRIP_HTML', 'STRIP_CRLF')
															    ),
								   'price'		    =>   array('output' => 'FINAL_PRICE_WITH_TAX',
																 'type' => 'KEYWORD',
															    ),
								   'brand'		    =>   array('output' => 'manufacturers_name',
																 'type' => 'DB',
																 'options' => array('STRIP_HTML', 'HTML_ENTITIES', 'STRIP_CRLF')
															    ),
								   'mpn'			  =>   array('output' => 'products_model',
																 'type' => 'DB'
															    ),
					 'google_product_category'	    =>   array('output' => 'FM_RS_google_categories_us_en',  //change the name to the name used for the function
																 'type' => 'FUNCTION'
															    ),
								   'product_type'	 =>   array('output' => 'CATEGORY_TREE',
																 'type' => 'KEYWORD',
																 'options' => array('STRIP_HTML', 'STRIP_CRLF')
															    ),
								   'link'			 =>   array('output' => 'PRODUCTS_URL',
																 'type' => 'KEYWORD'
															    ),
								   'image_link'	   =>   array('output' => 'IMAGE_URL',
																 'type' => 'KEYWORD'
															    ),
								   'condition'	    =>   array('output' => 'new', //change to 'used' or 'refurbished' if needed
																 'type' => 'VALUE'
															    ),
								   'description'	  =>   array('output' => 'products_description',
																 'type' => 'DB',
																 'options' => array('STRIP_HTML', 'STRIP_CRLF')
															    ),
								   'shipping_weight'  =>   array('output' => 'FM_RS_shipping_weight_and_unit',
																 'type' => 'FUNCTION',
															    ),
								   'availability'	    =>   array('output' => 'IS_IN_STOCK',
																 'type' => 'KEYWORD'
															    ),
								   /*'gender'	    =>   array('output' => 'female', //change to male or unisex if needed
																 /'type' => 'VALUE'
															    ),
								   'age_group'	    =>   array('output' => 'adult', //change to kids if needed
																 'type' => 'VALUE'
															    ),
								   'color'	    =>   array('output' => 'FM_RS_google_colors_us_en', //change the name to the name used for the function
																 'type' => 'FUNCTION',
															    ),
								   'size'	    =>   array('output' => 'FM_RS_google_sizes_us_en', //change the name to the name used for the function
																 'type' => 'FUNCTION',
															    ),
								   'material'	    =>   array('output' => 'products_material',
																 'type' => 'DB',
																 'options' => array('STRIP_HTML', 'STRIP_CRLF')
															    ),
								   'pattern'	    =>   array('output' => 'products_pattern',
																 'type' => 'DB',
																 'options' => array('STRIP_HTML', 'STRIP_CRLF')
															    ),
								   'online_only'	    =>   array('output' => 'y', //change to 'n' if your  shop is physical
																 'type' => 'VALUE'
															    ) //here no comma ( , )  if it's the last line*/
								  ),
				 'currency_decimal_override' => false,
				 'currency_thousands_override' => '',
				 'add_field_names' => true,
				 'category_tree_seperator' => ' ',
				 'seperator' => "\t",
				 'text_qualifier' => '',
				 'newline' => "\n",
				 'encoding' => 'false',
				 'include_record_function' => ''
			    );
//FEED FUNCTIONS BEGIN
function FM_RS_product_id_us_en($product) { //change the name to a unique name for each language and country
 return 'Azariahs-Fine-Things_' . $product['products_model'] . '';
}
function FM_RS_google_categories_us_en($product) { //change the name to a unique name for each language and country
$output_field_category = $product['categories_id'];
return (($output_field_category == 128) ? 'Health & Beauty > Personal Care > Massage & Relaxation' :
 (($output_field_category == 42) ? 'Health & Beauty > Personal Care > Cosmetics > Bath & Body':
  (($output_field_category == 122) ? 'Home & Garden > Decor > Candles':
   (($output_field_category == 78) ? 'Health & Beauty > Personal Care > Cosmetics > Perfume & Cologne':
 (($output_field_category == 44) ? 'Health & Beauty > Personal Care > Cosmetics > Perfume & Cologne':
  (($output_field_category == 45) ? 'Health & Beauty > Personal Care > Hair Care':
   (($output_field_category == 100) ? 'Health & Beauty > Personal Care > Cosmetics > Makeup':
    (($output_field_category == 48) ? 'Health & Beauty > Personal Care > Cosmetics > Skin Care':
	 ''))))))));
}
/*function FM_RS_google_condition_us_en($product) { //change the name to a unique name for each language and country
 return (($product['products_condition'] == 'New') ? 'new' : //change to the terms used in your shop for the feed-language
   (($product['products_condition'] == 'Used') ? 'used':
   (($product['products_condition'] == 'Overhauled') ? 'refurbished':
			 '')));
}
function FM_RS_google_gender_us_en($product) { //change the name to a unique name for each language and country
 return (($product['products_gender'] == 'Woman') ? 'female' : //change terms to the terms you use for each language in your shop
   (($product['products_gender'] == 'Men') ? 'male':
   (($product['products_gender'] == 'Unisex') ? 'unisex':
			 '')));
}
function FM_RS_google_age_group_us_en($product) { //change the name to a unique name for each language and country
 return (($product['products_age_group'] == 'Adult') ? 'adult' : //change terms to the terms you use for each language in your shop
   (($product['products_age_group'] == 'Kids') ? 'kids':
			 ''));
}
function FM_RS_google_colors_us_en($product) { //change the name to a unique name for each language and country
$color_query = tep_db_query("select pov.products_options_values_name as color
   from products_attributes as pa,
   products_options_values as pov,
   products_options as po
   where  pa.options_id = po. products_options_id
   and pa.options_values_id = pov.products_options_values_id
   and po.language_id = 1 and pov.language_id = 1
   and pa.options_id = 1
   AND pa.products_id = " . $product['products_id']);
while($color = tep_db_fetch_array($color_query)) {
$colors .= $color["color"] .", ";
}
$replace_color = array('01-', '02-', '03-', '04-', '05-', '06-', '07-', '08-', '09-','10-', '11-', '12-', '1-', '2-', '3-', '4-', '5-', '6-', 'A-', 'B-', 'C-');
$colors = str_replace($replace_color, '', $colors);
$colors = rtrim($colors, ", "); //this strips the last comma and white space
(($colors == '')? $colors = $product['products_color'] : '');
return $colors;
}
function FM_RS_google_sizes_us_en($product) { //change the name to a unique name for each language and country
$size_query = tep_db_query("select pov.products_options_values_name as size
   from products_attributes as pa,
   products_options_values as pov,
   products_options as po
   where  pa.options_id = po. products_options_id
   and pa.options_values_id = pov.products_options_values_id
   and po.language_id = 1 and pov.language_id = 1
   and pa.options_id = 2
   AND pa.products_id = " . $product['products_id']);
while($size = tep_db_fetch_array($size_query)) {
$sizes .= $size["size"] .", ";
}
$replace_size = array('01-', '02-', '03-', '04-', '05-', '06-', '07-', '08-', '09-','10-', '11-', '12-', '1-', '2-', '3-', '4-', '5-', '6-', 'A-', 'B-', 'C-');
$sizes = str_replace($replace_size, '', $sizes);
$sizes = rtrim($sizes, ", "); //this strips the last comma and white space
(($sizes == '')? $sizes = $product['products_size'] : '');
return $sizes;
}
//FEED FUNCTIONS END
*/
?>

Knowledge is useless, unless transferred.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

This is how I got this contribution working in my 2.3.1 store, hope its of help to some.

 

I added the files to the site as per the instructions and it will work as expected if you follow the link www.yoursite/admin/feedmachine_admin.php

 

The resulting page does not fit nicely within your admin system though.

 

To make it play nice, instead of adding --- require(DIR_WS_BOXES . 'feedmachine.php'); --- to admin/includes/column_left I instead assed the following to the tools dropdown --- admin/includes/boxes/tools.php after the who's online link:-

 

 array(
   'code' => 'Feedmachine',
   'title' => 'Feedmachine',
   'link' => tep_href_link(FILENAME_FEEDMACHINE)
)

 

and added FEEDMACHINE to the bottom of --- admin/includes/filename.php...

 

define('FILENAME_FEEDMACHINE', 'feedmachine_admin.php');

 

Now feedmachine_admin.php writes out it's own html document and that was breaking my styles and additionally adding duplicates of the left column so I edited the file to make it all fit nicely and display the proper 'update' button - see below. (Note I have changed some of the column headings to make them smaller to fit on my page and commented out a couple of drop-down menus that I don't need)

 

<?php
/**
* The Feedmachine Solution
*
* Generate feeds for any product search engine, e.g. Google Product Search, PriceGrabber, BizRate,
* DealTime, mySimon, Shopping.com, Yahoo! Shopping, PriceRunner.
* @package the-feedmachine-solution
* @[member='licensed2kill'] http://opensource.org/licenses/gpl-license.php GNU Public License
* @version 5.03
* @[member='Link'] http://www.osc-solutions.co.uk/ osCommerce Solutions
* @[member='copyright'] Copyright 2005-, Lech Madrzyk
* @[member='author'] Lech Madrzyk
*/
 require('includes/application_top.php');

 ini_set('display_errors', 'On');

 $action = isset($_POST['action']) ? $_POST['action'] : ( isset($_GET['action']) ? $_GET['action'] : false );

 $installation_path = dirname(__FILE__) . '/';
 require_once($installation_path . 'feedmachine_config.php');

 $catalog_path = defined('FM_CATALOG_DIRECTORY') ? FM_CATALOG_DIRECTORY : '../';
 chdir($catalog_path);
 $catalog_path = getcwd() . '/';

 chdir($installation_path);

 require_once($installation_path . 'feedmachine_loader.php');

 $feeds_location_web = HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FM_SAVE_LOCATION;
 $feeds_location_fs = $catalog_path . FM_SAVE_LOCATION;

 switch( $action ) {
case 'update':
  if( !empty($_POST['feeds_update']) && is_array($_POST['feeds_update']) ) {
	foreach( $_POST['feeds_update'] as $config_filename => $config ) {
	  $data = array('filename' => tep_db_prepare_input($config['filename']),
					'ftp_status' => tep_db_prepare_input($config['ftp_status']),
					'ftp_server' => tep_db_prepare_input($config['ftp_server']),
					'ftp_path' => tep_db_prepare_input($config['ftp_path']),
					'ftp_username' => tep_db_prepare_input($config['ftp_username']),
					'ftp_password' => tep_db_prepare_input($config['ftp_password']),
					'ftp_upload_period' => tep_db_prepare_input($config['ftp_upload_period']),
					'language_code' => tep_db_prepare_input($config['language_code']),
					'currency_code' => tep_db_prepare_input($config['currency_code']),
					'countries_iso_2' => tep_db_prepare_input($config['countries_iso_2']),
					'url_parameters' => tep_db_prepare_input($config['url_parameters']));
	  tep_db_perform('feedmachine', $data, 'update', 'config_filename = \'' . $config_filename . '\'');
	}
	$messageStack->add_session('Feed settings updated!', 'success');
  }
  break;
 }
  require(DIR_WS_INCLUDES . 'template_top.php');
?>
</td>
<td width="100%" valign="top">
<?php echo tep_draw_form('feedmachine_admin', 'feedmachine_admin.php') . tep_draw_hidden_field('action', 'update'); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading">Feedmachine Admin</td>
		<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td class="smallText"><input onclick="runFeedmachine()" type="button" value="Generate and Upload Feeds Now"></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="1">
	  <tr class="dataTableHeadingRow">
		<td class="dataTableHeadingContent">Filename</td>
		<td class="dataTableHeadingContent">Name</td>
  <td class="dataTableHeadingContent"> </td>
		<td class="dataTableHeadingContent">Lang</td>
		<!--<td class="dataTableHeadingContent">Currency</td>
		<td class="dataTableHeadingContent">Country</td>-->
		<td class="dataTableHeadingContent">URL Params</td>
		<td class="dataTableHeadingContent">FTP</td>
  <td class="dataTableHeadingContent">FTP Server</td>
  <td class="dataTableHeadingContent">FTP Path</td>
		<td class="dataTableHeadingContent">FTP Username</td>
		<td class="dataTableHeadingContent">FTP Password</td>
		<td class="dataTableHeadingContent">Period</td>
</tr>
<?php
 //Build Languages Array
 $languages_info = array();
 $languages_info_query = tep_db_query('SELECT * FROM ' . TABLE_LANGUAGES . ' ORDER BY code');
 while( $languages_info_row = tep_db_fetch_array($languages_info_query) ) {
$languages_info[] = array('id'   => $languages_info_row['code'],
						  'text' => $languages_info_row['code']);
 }
 //
 //Build Currencies Array
 $currencies_info = array();
 $currencies_info_query = tep_db_query('SELECT * FROM ' . TABLE_CURRENCIES . ' ORDER BY code');
 while( $currencies_info_row = tep_db_fetch_array($currencies_info_query) ) {
$currencies_info[] = array('id'   => $currencies_info_row['code'],
						   'text' => $currencies_info_row['code']);
 }
 //
 //Build Countries Array
 $countries_info = array();
 $countries_info_query = tep_db_query('SELECT * FROM ' . TABLE_COUNTRIES . ' ORDER BY countries_iso_code_2');
 while( $countries_info_row = tep_db_fetch_array($countries_info_query) ) {
$countries_info[] = array('id'   => $countries_info_row['countries_iso_code_2'],
						  'text' => $countries_info_row['countries_iso_code_2']);
 }
 //

 foreach( $feeds as $config_filename => $feed ) {
?>
	  <tr class="dataTableRow">
		<td class="main" style="font-size: 9px;"><?php echo current(explode('.php', $config_filename)); ?></td>
		<td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][filename]', $feed['filename'], 'size="14"'); ?></td>
  <td class="main"><?php echo file_exists($feeds_location_fs . $feed['filename']) ? '<a href="' . $feeds_location_web . $feed['filename'] . '" target="_blank">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>' : ''; ?></td>
		<td class="main"><?php echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][language_code]', $languages_info, $feed['language_code']); ?></td>
		<!--<td class="main"><?php // echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][currency_code]', $currencies_info, $feed['currency_code']); ?></td>
		<td class="main"><?php //echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][countries_iso_2]', $countries_info, $feed['countries_iso_2']); ?></td> -->
  <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][url_parameters]', $feed['url_parameters'], 'size="11"'); ?></td>
  <td class="main"><?php echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][ftp_status]', array(array('id' => '0', 'text' => 'Off'), array('id' => '1', 'text' => 'On')), $feed['ftp_status']); ?></td>
  <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_server]', $feed['ftp_server'], 'size="12"'); ?></td>
		<td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_path]', $feed['ftp_path'], 'size="8"'); ?></td>
		<td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_username]', $feed['ftp_username'], 'size="12"'); ?></td>
		<td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_password]', $feed['ftp_password'], 'size="12"'); ?></td>
		<td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_upload_period]', $feed['ftp_upload_period'], 'size="2"'); ?></td>
</tr>
<?php
 }
?>
</tr>
	</table>
	<!--</div>-->
 </td>
  </tr>
  <tr>
 <td class="main" align="left">
 <?php echo tep_draw_button(IMAGE_UPDATE, 'disk') //. tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
  </tr>
  <tr>
	<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
	<td class="smallText">
	  <table border="0" width="300" cellspacing="0" cellpadding="2" align="right" style="padding: 3px;">
		<tr class="infoBoxHeading">
		  <td class="infoBoxHeading"><b>Key</b></td>
		</tr>
		<tr>
		  <td class="infoBoxContent">
		  <b>Config Filename:</b> Filename of the feed configuration in <i>fm-feed-configs/</i> (displayed without the ".php" extension)<br>
		  <b>Feed Filename:</b> Filename of the feed that is created from the configuration<br>
		  <b>View:</b> Click on icon to view the feed (if it exists)<br>
		  <b>Country:</b> This is used to determine the tax set-up of the feed.<br>
		  <b>URL Params:</b> Additional parameters (in the form <i>var1=val1&var2=var2</i>) to add to the links output in the feed. E.g. for Google Analytics: <i>utm_source=[sOURCE]&utm_medium=[MEDIUM]&utm_campaign=[CAMPAIGN]</i><br>
		  <b>Period:</b> How often (in days) to re-upload a feed if there haven't been any changes. This can be set to prevent your feeds from expiring. <i>Applies to Feedmachine Auto only</i><br>
		  </td>
		</tr>
	  </table>
	  <p><b>File System Location of your feeds configuration directory (where to upload new feed configurations)</b><br><?php echo $installation_path . 'fm-feed-configs/'; ?></p>
	  <p><b>Web Location of your feeds</b><br><?php echo $feeds_location_web; ?></p>
	  <p><b>File System Location of your feeds</b><br><?php echo $feeds_location_fs; ?></p>
	  <p><b>Automation</b><br>To automate feed generation and upload, create a cron job to run the following command every 2 hours:<br><br>php <?php echo $installation_path . 'feedmachine_auto.php'; ?><br><br>Feedmachine Auto will generate and upload your feeds when it detects that your catalog has been updated. It also features a period of grace to ensure that your feeds are not generated in the middle of a catalog update.</p>
	  <p><b>Development</b><br>If you need help setting up more complex feed configurations or have other osC development work, please visit my website <a href="http://www.osc-solutions.co.uk/">osc-solutions.co.uk</a>.</p>
	</td>
  </tr>
</table>
</form>
</td>

 

As mentioned, I hope this is of use to someone :) Thanks to author for such a useful contribution.

Edited by AndrewRavenwood
Link to comment
Share on other sites

Too late to edit my original post...

 

I realised that I had lost the required Javascript from the previous example, so here it is with the alteration:-

 

<?php
/**
* The Feedmachine Solution
*
* Generate feeds for any product search engine, e.g. Google Product Search, PriceGrabber, BizRate,
* DealTime, mySimon, Shopping.com, Yahoo! Shopping, PriceRunner.
* @package the-feedmachine-solution
* @[member='licensed2kill'] http://opensource.org/licenses/gpl-license.php GNU Public License
* @version 5.03
* @[member='Link'] http://www.osc-solutions.co.uk/ osCommerce Solutions
* @[member='copyright'] Copyright 2005-, Lech Madrzyk
* @[member='author'] Lech Madrzyk
*/
 require('includes/application_top.php');

 ini_set('display_errors', 'On');

 $action = isset($_POST['action']) ? $_POST['action'] : ( isset($_GET['action']) ? $_GET['action'] : false );

 $installation_path = dirname(__FILE__) . '/';
 require_once($installation_path . 'feedmachine_config.php');

 $catalog_path = defined('FM_CATALOG_DIRECTORY') ? FM_CATALOG_DIRECTORY : '../';
 chdir($catalog_path);
 $catalog_path = getcwd() . '/';

 chdir($installation_path);

 require_once($installation_path . 'feedmachine_loader.php');

 $feeds_location_web = HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FM_SAVE_LOCATION;
 $feeds_location_fs = $catalog_path . FM_SAVE_LOCATION;

 switch( $action ) {
   case 'update':
  if( !empty($_POST['feeds_update']) && is_array($_POST['feeds_update']) ) {
    foreach( $_POST['feeds_update'] as $config_filename => $config ) {
	  $data = array('filename' => tep_db_prepare_input($config['filename']),
				    'ftp_status' => tep_db_prepare_input($config['ftp_status']),
				    'ftp_server' => tep_db_prepare_input($config['ftp_server']),
				    'ftp_path' => tep_db_prepare_input($config['ftp_path']),
				    'ftp_username' => tep_db_prepare_input($config['ftp_username']),
				    'ftp_password' => tep_db_prepare_input($config['ftp_password']),
				    'ftp_upload_period' => tep_db_prepare_input($config['ftp_upload_period']),
				    'language_code' => tep_db_prepare_input($config['language_code']),
				    'currency_code' => tep_db_prepare_input($config['currency_code']),
				    'countries_iso_2' => tep_db_prepare_input($config['countries_iso_2']),
				    'url_parameters' => tep_db_prepare_input($config['url_parameters']));
	  tep_db_perform('feedmachine', $data, 'update', 'config_filename = \'' . $config_filename . '\'');
    }
    $messageStack->add_session('Feed settings updated!', 'success');
  }
  break;
 }
  require(DIR_WS_INCLUDES . 'template_top.php');
?>
<script language="javascript" src="includes/general.js"></script>
<script language="javascript"><!--
function runFeedmachine() {
 window.open('<?php echo tep_href_link('feedmachine_auto.php', 'force_update=1'); ?>','feedmachine_console','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=400,screenX=150,screenY=150,top=150,left=150')
}
</script>
</td>
   <td width="100%" valign="top">
   <?php echo tep_draw_form('feedmachine_admin', 'feedmachine_admin.php') . tep_draw_hidden_field('action', 'update'); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
	    <td class="pageHeading">Feedmachine Admin</td>
	    <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
    </table></td>
  </tr>
  <tr>
    <td class="smallText"><input onclick="runFeedmachine()" type="button" value="Generate and Upload Feeds Now"></td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="1">
	  <tr class="dataTableHeadingRow">
	    <td class="dataTableHeadingContent">Filename</td>
	    <td class="dataTableHeadingContent">Name</td>
  <td class="dataTableHeadingContent"> </td>
	    <td class="dataTableHeadingContent">Lang</td>
	    <!--<td class="dataTableHeadingContent">Currency</td>
	    <td class="dataTableHeadingContent">Country</td>-->
	    <td class="dataTableHeadingContent">URL Params</td>
	    <td class="dataTableHeadingContent">FTP</td>
  <td class="dataTableHeadingContent">FTP Server</td>
  <td class="dataTableHeadingContent">FTP Path</td>
	    <td class="dataTableHeadingContent">FTP Username</td>
	    <td class="dataTableHeadingContent">FTP Password</td>
	    <td class="dataTableHeadingContent">Period</td>
   </tr>
<?php
 //Build Languages Array
 $languages_info = array();
 $languages_info_query = tep_db_query('SELECT * FROM ' . TABLE_LANGUAGES . ' ORDER BY code');
 while( $languages_info_row = tep_db_fetch_array($languages_info_query) ) {
   $languages_info[] = array('id'   => $languages_info_row['code'],
						  'text' => $languages_info_row['code']);
 }
 //
 //Build Currencies Array
 $currencies_info = array();
 $currencies_info_query = tep_db_query('SELECT * FROM ' . TABLE_CURRENCIES . ' ORDER BY code');
 while( $currencies_info_row = tep_db_fetch_array($currencies_info_query) ) {
   $currencies_info[] = array('id'   => $currencies_info_row['code'],
						   'text' => $currencies_info_row['code']);
 }
 //
 //Build Countries Array
 $countries_info = array();
 $countries_info_query = tep_db_query('SELECT * FROM ' . TABLE_COUNTRIES . ' ORDER BY countries_iso_code_2');
 while( $countries_info_row = tep_db_fetch_array($countries_info_query) ) {
   $countries_info[] = array('id'   => $countries_info_row['countries_iso_code_2'],
						  'text' => $countries_info_row['countries_iso_code_2']);
 }
 //

 foreach( $feeds as $config_filename => $feed ) {
?>
	  <tr class="dataTableRow">
	    <td class="main" style="font-size: 9px;"><?php echo current(explode('.php', $config_filename)); ?></td>
	    <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][filename]', $feed['filename'], 'size="14"'); ?></td>
  <td class="main"><?php echo file_exists($feeds_location_fs . $feed['filename']) ? '<a href="' . $feeds_location_web . $feed['filename'] . '" target="_blank">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>' : ''; ?></td>
	    <td class="main"><?php echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][language_code]', $languages_info, $feed['language_code']); ?></td>
	    <!--<td class="main"><?php // echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][currency_code]', $currencies_info, $feed['currency_code']); ?></td>
	    <td class="main"><?php //echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][countries_iso_2]', $countries_info, $feed['countries_iso_2']); ?></td> -->
  <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][url_parameters]', $feed['url_parameters'], 'size="11"'); ?></td>
  <td class="main"><?php echo tep_draw_pull_down_menu('feeds_update[' . $config_filename . '][ftp_status]', array(array('id' => '0', 'text' => 'Off'), array('id' => '1', 'text' => 'On')), $feed['ftp_status']); ?></td>
  <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_server]', $feed['ftp_server'], 'size="12"'); ?></td>
	    <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_path]', $feed['ftp_path'], 'size="8"'); ?></td>
	    <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_username]', $feed['ftp_username'], 'size="12"'); ?></td>
	    <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_password]', $feed['ftp_password'], 'size="12"'); ?></td>
	    <td class="main"><?php echo tep_draw_input_field('feeds_update[' . $config_filename . '][ftp_upload_period]', $feed['ftp_upload_period'], 'size="2"'); ?></td>
   </tr>
<?php
 }
?>
   </tr>
    </table>
    <!--</div>-->
 </td>
  </tr>
  <tr>
 <td class="main" align="left">
 <?php echo tep_draw_button(IMAGE_UPDATE, 'disk') //. tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
  </tr>
  <tr>
    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td class="smallText">
	  <table border="0" width="300" cellspacing="0" cellpadding="2" align="right" style="padding: 3px;">
	    <tr class="infoBoxHeading">
		  <td class="infoBoxHeading"><b>Key</b></td>
	    </tr>
	    <tr>
		  <td class="infoBoxContent">
		  <b>Config Filename:</b> Filename of the feed configuration in <i>fm-feed-configs/</i> (displayed without the ".php" extension)<br>
		  <b>Feed Filename:</b> Filename of the feed that is created from the configuration<br>
		  <b>View:</b> Click on icon to view the feed (if it exists)<br>
		  <b>Country:</b> This is used to determine the tax set-up of the feed.<br>
		  <b>URL Params:</b> Additional parameters (in the form <i>var1=val1&var2=var2</i>) to add to the links output in the feed. E.g. for Google Analytics: <i>utm_source=[sOURCE]&utm_medium=[MEDIUM]&utm_campaign=[CAMPAIGN]</i><br>
		  <b>Period:</b> How often (in days) to re-upload a feed if there haven't been any changes. This can be set to prevent your feeds from expiring. <i>Applies to Feedmachine Auto only</i><br>
		  </td>
	    </tr>
	  </table>
	  <p><b>File System Location of your feeds configuration directory (where to upload new feed configurations)</b><br><?php echo $installation_path . 'fm-feed-configs/'; ?></p>
	  <p><b>Web Location of your feeds</b><br><?php echo $feeds_location_web; ?></p>
	  <p><b>File System Location of your feeds</b><br><?php echo $feeds_location_fs; ?></p>
	  <p><b>Automation</b><br>To automate feed generation and upload, create a cron job to run the following command every 2 hours:<br><br>php <?php echo $installation_path . 'feedmachine_auto.php'; ?><br><br>Feedmachine Auto will generate and upload your feeds when it detects that your catalog has been updated. It also features a period of grace to ensure that your feeds are not generated in the middle of a catalog update.</p>
	  <p><b>Development</b><br>If you need help setting up more complex feed configurations or have other osC development work, please visit my website <a href="http://www.osc-solutions.co.uk/">osc-solutions.co.uk</a>.</p>
    </td>
  </tr>
   </table>
</form>
   </td>

 

Sorry for any inconvenience

Link to comment
Share on other sites

Last post today, honestly!

 

Had some trouble with the feed that this contribution produced by defauls - I assume certain database tables have altered since V2.2 OSCom.... So to get what I needed I altered the following in admin/fm-feed-configs/google-simple.php:-

 

The script wasn't producing a price so I changed the value to this

 

'price'   =>   array( 'output' => 'FM_UF_addprice',
						   'type' => 'FUNCTION'
						),	

 

Then added this simple function at the top of the page under the introduction

 

function FM_UF_addprice($product) {
 return '£' . $product['products_price'];
}

 

In addition I added a new array for Googles product category

 

'google product category' =>   array('output' => 'google_product_category',
													   'type' => 'DB'
													  )

 

which meant that I had to add a new column to my database in the 'products' table and populate it with Googles relevant catagories in the following format.

 

Category > Sub category

 

It means I will have to play with the admin page so that these can be added when the products are added.

 

Now, to be honest, at this stage I don't know if I will need to tinker more to get this and Google to be best friends but at least this covers the most immediate issues that I faced.

 

I think this contribution could do with an update and hope the original author is willing to keep it current. I consider a lot of what I've done today to be hacks!

Edited by AndrewRavenwood
Link to comment
Share on other sites

  • 1 month later...

Hi,

i have installed this contribution, version 5.03 of 15 may 2010, on my oscommerce 2.2

 

I will advance that my site has two active languages: Italian(code = it, languages_id = 6) and English(en, 7).

 

From the admin panel I want to create two separate feed for the two languages, for example, using the configuration file "google-simple."

 

Problem: if i set language = en and create the feed, this selects all products in the "it" instead of those in the "en".

 

In the file / admin / feedmachine.php

the follow code always generates the code, and only the following value:

 

$ languages_list = 6 and also $ languages_used = 6

 

//Build Languages Array
$languages = array();
$languages_query = tep_db_query('SELECT * FROM ' . TABLE_LANGUAGES);
while( $languages_row = tep_db_fetch_array($languages_query) ) {
 $languages[ $languages_row['code'] ] = $languages_row;
}
tep_db_free_result($languages_query);
echo 'languages array built' . "\n";
ob_flush();
//

// Debug: STAMPA ARRAY $languages
print_r($languages);

//Which languages are needed for the feeds?
//If only some are needed, this will save time in the master query
$languages_used = array();
foreach( $feeds as $key=>$feed ) {

 if( isset($feed['language_code']) && isset($languages[ $feed['language_code'] ]['languages_id']) ) {
   $feeds[$key]['language_id'] = $languages[ $feed['language_code'] ]['languages_id'];
 }

 if( isset($feeds[$key]['language_id']) ) {
   $languages_used[ $feeds[$key]['language_id'] ] = $feeds[$key]['language_id'];
 }
}

$languages_list = implode(',', $languages_used);
//

 

This piece of code should do what exactly?

I make a mistake?

 

Thank for your help.

Ad Maiora

 

Link to comment
Share on other sites

I have insert this code

 

// Debug: STAMPA ARRAY $feeds
print_r($feed);

 

before this:

 

//Which languages are needed for the feeds?
//If only some are needed, this will save time in the master query
$languages_used = array();
foreach( $feeds as $key=>$feed ) {

 if( isset($feed['language_code']) && isset($languages[ $feed['language_code'] ]['languages_id']) ) {
   $feeds[$key]['language_id'] = $languages[ $feed['language_code'] ]['languages_id'];
 }

 if( isset($feeds[$key]['language_id']) ) {
   $languages_used[ $feeds[$key]['language_id'] ] = $feeds[$key]['language_id'];
 }

 

The values printed are:

 

    .........
   [id] => 1
   [config_filename] => google-simple.php
   [ftp_status] => 0
   [ftp_server] => 
   [ftp_path] => 
   [ftp_username] => 
   [ftp_password] => 
   [ftp_upload_period] => 30
   [language_code] => it
   [currency_code] => EUR
   [countries_iso_2] => IT
   [url_parameters] => utm_source=google-simple&utm_medium=product_search&utm_campaign=google-simple

 

ERROR!

I have insert language_code=en !!!

I have insert different values for ftp_server,ftp_path,ftp_username,ftp_password !!!

The valuesa are stored correctly in the table feedmachine at row 1, but are not used.

 

Help me, thanks

Ad Maiora

 

Link to comment
Share on other sites

  • 2 months later...

I have searched every page of this thread and the issue of excluding diabled categories has come up a couple of times both with unsatisfactory answers and no solution, other than write a custom function. Well i know i need to use a custom function but i am struggling to write that function. I am using 'Enable & Disable Categories - http://addons.oscommerce.com/info/326' and ask if anybody has a function to exclude categories or can help in writing the function i would really appreciate hearing from you.

 

Thanks,

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