Jump to content



Photo
- - - - -

The Feedmachine Solution


  • Please log in to reply
254 replies to this topic

#21   Richard Cranium

Richard Cranium
  • Members
  • 144 posts
  • Real Name:David

Posted 25 November 2009 - 19:53

Lech,

I may have found the source of the problem in the admin file. I noticed this peculiarity... $languages changes between the build langs code (lines 38-44 of the admin file) and when the drop down languages menu is created in line 166. I believe the problem is due to header.php being called. My admin header file sets up $languages for its own use. So, i am thinking if the variable name is changed in your files (i.e. to $languages_<something else>), perhaps it will start working. I was thinking of this a few days ago that maybe the variable names being the same are causing a conflict and something else you might want to change in a future version since $languages is used globally.

I'm going to try my hand at changing the variable name for $languages and see what happens.

Here is what my $languages var looks like just before the admin file tries to draw the admin drop down (note: this is actually one line of output, but I used CR's to make it easier to read on the forum):

Array ( 
[0] => Array ( [id] => 1 [name] => English (USA) [code] => en [image] => icon.gif [directory] => english ) 
[1] => Array ( [id] => 3 [name] => Español [code] => es [image] => mexico_icon.gif [directory] => espanol ) 
[2] => Array ( [id] => 4 [name] => Français [code] => fr [image] => icon.gif [directory] => french ) 
[3] => Array ( [id] => 2 [name] => Deutsch [code] => de [image] => icon.gif [directory] => german ) 
[4] => Array ( [id] => 9 [name] => Canada (English) [code] => ca [image] => icon_ca.gif [directory] => english_ca )
[5] => Array ( [id] => 8 [name] => Australia [code] => au [image] => icon_au.gif [directory] => english_au ) 
[6] => Array ( [id] => 11 [name] => New Zealand [code] => nz [image] => icon_nz.gif [directory] => english_nz ) 
[7] => Array ( [id] => 7 [name] => United Kingdom [code] => uk [image] => icon_uk.gif [directory] => english_uk ) 
)

As you can see, the 'id' field in the array changed from being equal to the languages 'code' to the 'languages_id' in the array. I'm sure this has got to be mucking things up somehow.

David

Edited by Richard Cranium, 25 November 2009 - 19:58.


#22   Richard Cranium

Richard Cranium
  • Members
  • 144 posts
  • Real Name:David

Posted 25 November 2009 - 22:05

*** One Bug Resolved ***

Yes, I was correct. I changed the $languages var name to $languages_fm and the feedmachine_admin.php file now works properly.

I'm still working on the 1064 SQL error in feedmachine.php. We'll see if it's related.

Either way, my advice is to change any $language or $languages variables to a unique name. If global variables are turned off it would be a non-issue, but with them on as seems to be common it has the potential to create such conflicts. I've also changed the SQL script references to pointers where appropriate (e.g. TABLE_LANGUAGES instead of languages; same with currencies, etc.).

I'll report back on the 1064 error if I find a solution.

As an example, my "build languages" code section in feedmachine_admin.php now looks like this:


  //Build Languages Array
  $languages_fm = array();
  $languages_query = tep_db_query('SELECT * FROM ' . TABLE_LANGUAGES . ' ORDER BY code');
  while( $languages_row = tep_db_fetch_array($languages_query) ) {
    $languages_fm[] = array('id'   => $languages_row['code'],
                         'text' => $languages_row['code']);
  }
  //


David

Edited by Richard Cranium, 25 November 2009 - 22:06.


#23   Richard Cranium

Richard Cranium
  • Members
  • 144 posts
  • Real Name:David

Posted 25 November 2009 - 22:40

*** SQL 1064 Error Resolved ***

I've got this solved now too with the problem in feedmachine.php. It seemed to work ok even with the $languages var (i.e. dup of the global variable), but I changed all instances to $languages_fm just in case. Also had to run it twice the first time, but it all works great now.

I would suggest as a new feature the ability to create duplicate feeds with different options, using the same feed config. For example, let's say that I need 2 feeds built off Google Simple config, one in English and one in Spanish, both in US Dollars. Right now I seem to have to do them one at a time, changing (updating) the config in the process. Or I can make a duplicate of the Google Simple config file, rename it, and run both at the same time. But if I wanted to do this frequently it seems to me that this would become tedious.

Perhaps this is possible and I just have not figured out how to do it with the current setup, but it does not seem possible to me atm.

#24   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 27 November 2009 - 01:08

Well done for getting to the bottom of this. I'll make changes in the upcoming version. (By the way, the problem occurring in feedmachine.php was a direct consequence of no language being selected in Feedmachine Admin. feedmachine.php doesn't include any external code after the languages array is generated that could change it.)

I would suggest as a new feature the ability to create duplicate feeds with different options, using the same feed config. For example, let's say that I need 2 feeds built off Google Simple config, one in English and one in Spanish, both in US Dollars. Right now I seem to have to do them one at a time, changing (updating) the config in the process. Or I can make a duplicate of the Google Simple config file, rename it, and run both at the same time. But if I wanted to do this frequently it seems to me that this would become tedious.


I think it will be quite rare to need multiple versions of the same feed, so I think making copies of the configuration file is quite acceptable. Besides, there are small differences between the different language versions of the google feeds and having separate configuration files allows you to accommodate for these differences.

By the way, I'm afraid at the moment there is no Spanish version of Google Product Search. There are only UK, German and US versions.

#25   anuksamun

anuksamun
  • Members
  • 10 posts
  • Real Name:Mihai

Posted 28 November 2009 - 01:38

how can i make a feed to have this fields and to be in xml?
<Products>
<Product>bla bla</product>
<Manufacturer>xxxx</Manufacturer>
<Name>bla bla bla</Name>
<Product_Url>http://www.blabla.co...m</Product_Url>
<Image_url>http://www.blabla.co...jpg</Image_url>
<Price>123</Price>
<category>bl;a bla bla</category>
<Description>more bla bla about the product</Description>
<Product_model>model of product</Product_model>
</Product>

#26   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 29 November 2009 - 12:19

I am afraid at the moment Feedmachine does not produce xml feeds. I might add this functionality in a future version, but to be honest I think that xml is inefficient for product feeds and all product search engines should except tab-delimited/csv feeds.

What product search engine are you trying to create a feed for and does it only accept xml feeds?

#27   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 30 November 2009 - 13:29

In the windows which opens I am getting this error:

Warning: Invalid argument supplied for foreach() in /home/verzekerd/www/admin/feedmachine.php on line 458

#28   devine952

devine952
  • Members
  • 69 posts
  • Real Name:Rob
  • Gender:Male

Posted 30 November 2009 - 18:53

Hi,

Great Contrib! I have used the first one for a couple of years and now I have just upgraded to this one.

During the install I experienced problems with the end of the SQL file:

`url_parameters` varchar(256) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `config_filename` (`config_filename`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

It wouldn't accept this so I had to change it to varchar(255) and remove
ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

Is this ok? or does it have bad consequences.

As I said it is creating my fm-feeds file ok.

The other problem is FTP settings when viewing feedmachine_admin.php

I haven't used FTP before with google, rather uploading manually. google says uploads.google.com but they don't specify a path. Also when I update, FTP always stays OFF. Is this normal? even after scrolling it to ON, when I update it goes back to OFF.

Any help welcome.

Regards,
Rob

#29   devine952

devine952
  • Members
  • 69 posts
  • Real Name:Rob
  • Gender:Male

Posted 30 November 2009 - 22:23

Hi,

Great Contrib! I have used the first one for a couple of years and now I have just upgraded to this one.

During the install I experienced problems with the end of the SQL file:

`url_parameters` varchar(256) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `config_filename` (`config_filename`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

It wouldn't accept this so I had to change it to varchar(255) and remove
ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

Is this ok? or does it have bad consequences.

As I said it is creating my fm-feeds file ok.

The other problem is FTP settings when viewing feedmachine_admin.php

I haven't used FTP before with google, rather uploading manually. google says uploads.google.com but they don't specify a path. Also when I update, FTP always stays OFF. Is this normal? even after scrolling it to ON, when I update it goes back to OFF.

Any help welcome.

Regards,
Rob

I just wanted to add that I am getting an encoding error in description field. I don't know why so I have linked the text file. I reduced it to 4 items, so the file won't be too big too look at. Text File

#30   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 01 December 2009 - 11:28

In the windows which opens I am getting this error:

Warning: Invalid argument supplied for foreach() in /home/verzekerd/www/admin/feedmachine.php on line 458


Hi,

Please make sure you are using the latest version and that you have updated all files.

Do all feeds have a language selected in Feedmachine Admin?

#31   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 01 December 2009 - 11:48

Great to hear from a user of the original Feedmachine! I hope you will find the new system even better.

The changes you made to the sql are fine.

The FTP On/Off problem is a small bug that I will sort out in the next version - thanks for pointing it out. The problem is that the drop-down is not displaying the correct status, though you are turning ftp on and off when updating.

Hi,

Great Contrib! I have used the first one for a couple of years and now I have just upgraded to this one.

During the install I experienced problems with the end of the SQL file:

`url_parameters` varchar(256) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `config_filename` (`config_filename`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

It wouldn't accept this so I had to change it to varchar(255) and remove
ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

Is this ok? or does it have bad consequences.

As I said it is creating my fm-feeds file ok.

The other problem is FTP settings when viewing feedmachine_admin.php

I haven't used FTP before with google, rather uploading manually. google says uploads.google.com but they don't specify a path. Also when I update, FTP always stays OFF. Is this normal? even after scrolling it to ON, when I update it goes back to OFF.

Any help welcome.

Regards,
Rob



#32   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 01 December 2009 - 11:51

Hi,

Please make sure you are using the latest version and that you have updated all files.

Do all feeds have a language selected in Feedmachine Admin?


We have uploaded the latest version. Do we must/have to do the SQL?

#33   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 01 December 2009 - 12:02

No.

Do all feeds have a language selected in Feedmachine Admin?

We have uploaded the latest version. Do we must/have to do the SQL?



#34   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 01 December 2009 - 12:03

No.

Do all feeds have a language selected in Feedmachine Admin?


yes, they have


catalog path: /home/verzekerd/www/

languages array built
currencies array built
taxes array built
countries array built
categories array built

number of products: 220
number of cycles: 1

feed configurations checked... output begun.

cycle: 1

products array built
products attributes array built
feed generation in process...


Warning: Invalid argument supplied for foreach() in /home/verzekerd/www/admin/feedmachine.php on line 458


done.

Edited by misa, 01 December 2009 - 12:06.


#35   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 01 December 2009 - 12:44

Hi,

Are your feeds empty?

please add

print_r($cur_feed);
foreach( $products as $key => $value ) {
  echo $key . "\n";
}

directly below line 457 and let me know what you get.

yes, they have


catalog path: /home/verzekerd/www/

languages array built
currencies array built
taxes array built
countries array built
categories array built

number of products: 220
number of cycles: 1

feed configurations checked... output begun.

cycle: 1

products array built
products attributes array built
feed generation in process...


Warning: Invalid argument supplied for foreach() in /home/verzekerd/www/admin/feedmachine.php on line 458


done.



#36   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 01 December 2009 - 16:49

I am getting thid in the popup window:

catalog path: /home/verzekerd/www/

languages array built
currencies array built
taxes array built
countries array built
categories array built

number of products: 220
number of cycles: 1

feed configurations checked... output begun.

cycle: 1

products array built
products attributes array built
feed generation in process...
Array
(
[name] => Google Product Search Simple Configuration
[authors] => Lech
[filename] => google-product-search.txt
[schema_version] => 2.0
[fields] => Array
(
[id] => Array
(
[output] => products_id
[type] => DB
)

[title] => Array
(
[output] => products_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[price] => Array
(
[output] => FINAL_PRICE
[type] => KEYWORD
)

[brand] => Array
(
[output] => manufacturers_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[mpn] => Array
(
[output] => products_model
[type] => DB
)

[product_type] => Array
(
[output] => CATEGORY_TREE
[type] => KEYWORD
[options] => Array
(
[0] => STRIP_HTML
[1] => STRIP_CRLF
)

)

[link] => Array
(
[output] => PRODUCTS_URL
[type] => KEYWORD
)

[image_link] => Array
(
[output] => IMAGE_URL
[type] => KEYWORD
)

[condition] => Array
(
[output] => new
[type] => VALUE
)

[description] => Array
(
[output] => products_description
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

)

[add_field_names] => 1
[seperator] =>
[text_qualifier] =>
[category_tree_seperator] =>
[newline] =>

[encoding] => utf8
[currency_decimal_override] =>
[currency_thousands_override] =>
[include_record_function] =>
[id] => 1
[config_filename] => google-simple.php
[ftp_status] => 0
[ftp_server] =>
[ftp_path] =>
[ftp_username] =>
[ftp_password] =>
[ftp_upload_period] => 0
[language_code] => 4
[currency_code] => EUR
[countries_iso_2] => NL
[url_parameters] =>
[currency_decimal] => ,
[currency_thousands] =>
)
4


Warning: Invalid argument supplied for foreach() in /home/verzekerd/www/admin/feedmachine.php on line 462

Array
(
[name] => Pricerunner UK
[filename] => pricerunner.csv
[authors] => Lech
[schema_version] => 2.0
[fields] => Array
(
[Category] => Array
(
[output] => CATEGORY
[type] => KEYWORD
[options] => Array
(
[0] => STRIP_HTML
[1] => STRIP_CRLF
)

)

[Manufacturer] => Array
(
[output] => manufacturers_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[Product ID] => Array
(
[output] => products_id
[type] => DB
)

[Product Name] => Array
(
[output] => products_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[Price] => Array
(
[output] => FINAL_PRICE
[type] => KEYWORD
)

[Product URL] => Array
(
[output] => PRODUCTS_URL
[type] => KEYWORD
)

[Image URL] => Array
(
[output] => IMAGE_URL
[type] => KEYWORD
)

[Shipping] => Array
(
[output] => 0
[type] => VALUE
)

[Stock Level] => Array
(
[output] => In Stock
[type] => VALUE
)

[Retailer message] => Array
(
[output] =>
[type] => VALUE
)

[Description] => Array
(
[output] => products_description
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

)

[currency_decimal_override] =>
[currency_thousands_override] =>
[add_field_names] => 1
[category_tree_seperator] =>
[seperator] => ,
[text_qualifier] => "
[newline] =>

[encoding] => utf8
[include_record_function] =>
[id] => 2
[config_filename] => pricerunner-uk.php
[ftp_status] => 0
[ftp_server] =>
[ftp_path] =>
[ftp_username] =>
[ftp_password] =>
[ftp_upload_period] => 0
[language_code] => du
[currency_code] => EUR
[countries_iso_2] => NL
[url_parameters] =>
[language_id] => 4
[currency_decimal] => ,
[currency_thousands] =>
)
4

done.


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

start time: 2009-12-01 17:47:28 CET
end time: 2009-12-01 17:47:29 CET
runtime: 0.30362010002136


GLOBAL UPDATE TRIGGERS
----------------------
this was a force update

NOTICES
-------
this was a manual update
this run was triggered via HTTP


F E E D S

Google Product Search Simple Configuration
------------
update status: feed updated as part of a force update
upload trigger status: feed upload not triggered because feed upload is disabled
upload status: feed was not uploaded(0)

Pricerunner UK
------------
update status: feed updated as part of a force update
upload trigger status: feed upload not triggered because feed upload is disabled
upload status: feed was not uploaded(0)

#37   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 01 December 2009 - 16:53

I think you've entered language_code in the google feed config manually. If so you need to delete the 'language_code' line from the configuration.

I am getting thid in the popup window:

catalog path: /home/verzekerd/www/

languages array built
currencies array built
taxes array built
countries array built
categories array built

number of products: 220
number of cycles: 1

feed configurations checked... output begun.

cycle: 1

products array built
products attributes array built
feed generation in process...
Array
(
[name] => Google Product Search Simple Configuration
[authors] => Lech
[filename] => google-product-search.txt
[schema_version] => 2.0
[fields] => Array
(
[id] => Array
(
[output] => products_id
[type] => DB
)

[title] => Array
(
[output] => products_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[price] => Array
(
[output] => FINAL_PRICE
[type] => KEYWORD
)

[brand] => Array
(
[output] => manufacturers_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[mpn] => Array
(
[output] => products_model
[type] => DB
)

[product_type] => Array
(
[output] => CATEGORY_TREE
[type] => KEYWORD
[options] => Array
(
[0] => STRIP_HTML
[1] => STRIP_CRLF
)

)

[link] => Array
(
[output] => PRODUCTS_URL
[type] => KEYWORD
)

[image_link] => Array
(
[output] => IMAGE_URL
[type] => KEYWORD
)

[condition] => Array
(
[output] => new
[type] => VALUE
)

[description] => Array
(
[output] => products_description
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

)

[add_field_names] => 1
[seperator] =>
[text_qualifier] =>
[category_tree_seperator] =>
[newline] =>

[encoding] => utf8
[currency_decimal_override] =>
[currency_thousands_override] =>
[include_record_function] =>
[id] => 1
[config_filename] => google-simple.php
[ftp_status] => 0
[ftp_server] =>
[ftp_path] =>
[ftp_username] =>
[ftp_password] =>
[ftp_upload_period] => 0
[language_code] => 4
[currency_code] => EUR
[countries_iso_2] => NL
[url_parameters] =>
[currency_decimal] => ,
[currency_thousands] =>
)
4


Warning: Invalid argument supplied for foreach() in /home/verzekerd/www/admin/feedmachine.php on line 462

Array
(
[name] => Pricerunner UK
[filename] => pricerunner.csv
[authors] => Lech
[schema_version] => 2.0
[fields] => Array
(
[Category] => Array
(
[output] => CATEGORY
[type] => KEYWORD
[options] => Array
(
[0] => STRIP_HTML
[1] => STRIP_CRLF
)

)

[Manufacturer] => Array
(
[output] => manufacturers_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[Product ID] => Array
(
[output] => products_id
[type] => DB
)

[Product Name] => Array
(
[output] => products_name
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

[Price] => Array
(
[output] => FINAL_PRICE
[type] => KEYWORD
)

[Product URL] => Array
(
[output] => PRODUCTS_URL
[type] => KEYWORD
)

[Image URL] => Array
(
[output] => IMAGE_URL
[type] => KEYWORD
)

[Shipping] => Array
(
[output] => 0
[type] => VALUE
)

[Stock Level] => Array
(
[output] => In Stock
[type] => VALUE
)

[Retailer message] => Array
(
[output] =>
[type] => VALUE
)

[Description] => Array
(
[output] => products_description
[type] => DB
[options] => Array
(
[0] => STRIP_HTML
[1] => HTML_ENTITIES
[2] => STRIP_CRLF
)

)

)

[currency_decimal_override] =>
[currency_thousands_override] =>
[add_field_names] => 1
[category_tree_seperator] =>
[seperator] => ,
[text_qualifier] => "
[newline] =>

[encoding] => utf8
[include_record_function] =>
[id] => 2
[config_filename] => pricerunner-uk.php
[ftp_status] => 0
[ftp_server] =>
[ftp_path] =>
[ftp_username] =>
[ftp_password] =>
[ftp_upload_period] => 0
[language_code] => du
[currency_code] => EUR
[countries_iso_2] => NL
[url_parameters] =>
[language_id] => 4
[currency_decimal] => ,
[currency_thousands] =>
)
4

done.


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

start time: 2009-12-01 17:47:28 CET
end time: 2009-12-01 17:47:29 CET
runtime: 0.30362010002136


GLOBAL UPDATE TRIGGERS
----------------------
this was a force update

NOTICES
-------
this was a manual update
this run was triggered via HTTP


F E E D S

Google Product Search Simple Configuration
------------
update status: feed updated as part of a force update
upload trigger status: feed upload not triggered because feed upload is disabled
upload status: feed was not uploaded(0)

Pricerunner UK
------------
update status: feed updated as part of a force update
upload trigger status: feed upload not triggered because feed upload is disabled
upload status: feed was not uploaded(0)



#38   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 01 December 2009 - 17:03

Ok..........thanks and fixed.

This contribution wil help me a lot..........thanks

Another question, will this work also on Creloaded?

Edited by misa, 01 December 2009 - 17:07.


#39   lech

lech
  • Members
  • 135 posts
  • Real Name:Lech

Posted 01 December 2009 - 20:20

Yes

Ok..........thanks and fixed.

This contribution wil help me a lot..........thanks

Another question, will this work also on Creloaded?



#40   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 01 December 2009 - 20:48

Yes


am getting this error then:

cycle: 1

products array built
1054 - Unknown column 'po.language_id' in 'on clause'

SELECT *
FROM products_attributes pa LEFT JOIN products_options po ON pa.options_id = po.products_options_id
LEFT JOIN products_options_values pov ON pa.options_values_id = pov.products_options_values_id AND po.language_id = pov.language_id
WHERE pa.products_id BETWEEN 11 AND 375

TEP_DB_ERRORR