Re: Re: Re: Yes actually,
CSV Import 0.1 Alpha (57 replies) Mon, 09/24/2007 - 12:16
- Attribute imort example (04/22/2008 - 09:17)
- Re: Attribute imort example (05/28/2008 - 14:37)
- Re: CSV Import 0.1 Alpha (03/18/2008 - 02:36)
- Multiple Options Import (12/19/2007 - 17:05)
- Summary of Progress (12/19/2007 - 16:26)
- Re: Summary of Progress (12/19/2007 - 17:01)
- Re: Re: Summary of Progress (01/03/2008 - 11:00)
- Re: Re: Re: Summary of Progress (01/11/2008 - 16:13)
- Re: Re: Re: Re: Summary of Progress (01/12/2008 - 13:14)
- CSV import should be included (02/14/2008 - 10:24)
- Re: CSV import should be included (03/14/2008 - 06:52)
- The editable fields module (02/15/2008 - 15:54)
- Hi Rich,
Thanks for your (03/06/2008 - 19:59)
- Re: Hi Rich,
Thanks for your (03/07/2008 - 03:19)
- Re: Re: Hi Rich, Thanks for your (03/07/2008 - 09:10)
- Re: Hi Rich,
Thanks for your (03/07/2008 - 03:19)
- Hi Rich,
Thanks for your (03/06/2008 - 19:59)
- CSV import should be included (02/14/2008 - 10:24)
- Re: Re: Re: Re: Summary of Progress (01/12/2008 - 13:14)
- Re: Re: Re: Summary of Progress (01/11/2008 - 16:13)
- Re: Re: Summary of Progress (01/03/2008 - 11:00)
- Re: Summary of Progress (12/19/2007 - 17:01)
- Re: CSV Import 0.1 Alpha (10/19/2007 - 04:12)
- Yes actually,
You just have (10/23/2007 - 11:42)
- Re: Yes actually,
You just have (10/23/2007 - 15:17)
- Re: Re: Yes actually,
You just have (11/06/2007 - 08:20)
- Re: Re: Re: Yes actually, You just have (11/14/2007 - 20:09)
- Re: Re: Re: Yes actually, (11/08/2007 - 04:09)
- Re: Re: Re: Re: Yes actually, (11/09/2007 - 12:04)
- Re: Re: Re: Re: Re: Yes actually, (11/09/2007 - 14:45)
- hi quaoar,
can I see your (11/09/2007 - 18:10)
- Re: hi quaoar,
can I see your (11/09/2007 - 18:52)
- Re: Re: hi quaoar, (11/10/2007 - 15:50)
- Ha yes,
good point. I (11/11/2007 - 13:56)
- Re: Ha yes,
good point. I (11/12/2007 - 10:12)
- Re: Re: Ha yes,
good point. I (11/12/2007 - 11:26)
- Re: Re: Re: Ha yes,
good point. I (11/18/2007 - 10:29)
- some help maybe? (11/22/2007 - 14:14)
- node_import add-on (11/23/2007 - 06:52)
- ubecart 2 (01/09/2009 - 11:18)
- Blank Screen at Preview Stage (06/25/2008 - 18:35)
- Re: Blank Screen at Preview Stage (09/02/2008 - 11:59)
- Re: Re: Blank Screen at Preview Stage (01/16/2009 - 07:37)
- Re: Re: Re: Blank Screen at Preview Stage (03/03/2009 - 14:18)
- Re: Re: Re: Re: Blank Screen at Preview Stage (03/06/2009 - 10:04)
- Node import (03/24/2009 - 11:29)
- Re: Re: Re: Re: Blank Screen at Preview Stage (03/06/2009 - 10:04)
- Re: Re: Re: Blank Screen at Preview Stage (03/03/2009 - 14:18)
- Re: Re: Blank Screen at Preview Stage (01/16/2009 - 07:37)
- Re: Blank Screen at Preview Stage (09/02/2008 - 11:59)
- Attribute support for node_import add-on (06/19/2008 - 01:48)
- Re: Attribute support for node_import add-on (06/19/2008 - 17:28)
- puplicate nodes (12/17/2007 - 23:41)
- Hy!
I saw that you get a (11/25/2007 - 12:31)
- Re: Hy!
I saw that you get a (11/25/2007 - 13:01)
- Another point (11/25/2007 - 13:49)
- Re: Another point (11/25/2007 - 16:04)
- Re: Re: Another point (11/25/2007 - 16:53)
- Re: Another point (11/25/2007 - 16:04)
- Re: Re: Hy! I saw that you get a (11/25/2007 - 13:11)
- Another point (11/25/2007 - 13:49)
- Re: Hy!
I saw that you get a (11/25/2007 - 13:01)
- node_import add-on (11/23/2007 - 06:52)
- some help maybe? (11/22/2007 - 14:14)
- Re: Re: Re: Ha yes,
good point. I (11/18/2007 - 10:29)
- Re: Re: Ha yes,
good point. I (11/12/2007 - 11:26)
- Re: Ha yes,
good point. I (11/12/2007 - 10:12)
- Ha yes,
good point. I (11/11/2007 - 13:56)
- Re: Re: hi quaoar, (11/10/2007 - 15:50)
- Re: hi quaoar,
can I see your (11/09/2007 - 18:52)
- hi quaoar,
can I see your (11/09/2007 - 18:10)
- Re: Re: Re: Re: Re: Yes actually, (11/09/2007 - 14:45)
- Re: Re: Re: Re: Yes actually, (11/09/2007 - 12:04)
- Re: Re: Yes actually,
You just have (11/06/2007 - 08:20)
- Re: Yes actually,
You just have (10/23/2007 - 15:17)
- Yes actually,
You just have (10/23/2007 - 11:42)
- Re: CSV Import 0.1 Alpha (09/24/2007 - 21:44)
- Time out error and fatal memory error (12/12/2007 - 00:51)
- Re: Re: CSV Import 0.1 Alpha (09/24/2007 - 22:18)
- Re: Re: Re: CSV Import 0.1 Alpha (09/25/2007 - 05:17)
- Re: Re: Re: Re: CSV Import 0.1 Alpha (10/11/2007 - 08:41)
- Hey, it works fine! Will it (11/10/2007 - 15:25)
- Re: Re: Re: Re: Re: CSV Import 0.1 Alpha (10/11/2007 - 09:13)
- Re: Re: Re: Re: Re: Re: CSV Import 0.1 Alpha (10/11/2007 - 09:49)
- Re: Re: Re: Re: Re: Re: Re: CSV Import 0.1 Alpha (10/11/2007 - 10:05)
- Re: Re: Re: Re: Re: Re: CSV Import 0.1 Alpha (10/11/2007 - 09:49)
- Re: Re: Re: Re: CSV Import 0.1 Alpha (10/11/2007 - 08:41)
- Re: Re: Re: CSV Import 0.1 Alpha (09/25/2007 - 05:17)

CpILL your module worked great after I made some additions and one change to the module.
Had to add some form of "input control" on the data in the CSV file.
Changed this line:
$row[$form_values['column_'.$i]] = $csv_row[$i];
To this:
$row[$form_values['column_'.$i]] = str_replace('&', '&',$csv_row[$i]);
Added these functions (based heavily on your product attributes functions):
/*** Implements hook_uc_import_csv_fields_list()
*
* returns an array of the fields available for the selected product class
*/
function content_uc_import_csv_fields_list($values) {
if(!empty($values['class'])) {
$fields = content_fields(null,$values['class']);
if(count($fields)) {
$fields = array_keys($fields);
sort($fields);
$field_names = array();
foreach($fields as $field) {
$field_name['cck_'.$field] = $field;
}
return array('CCK fields' => $field_name);
}
}
}
/**
* Implements hook_uc_import_csv_row()
*
* Adds the cck values to the xml object
*/
function content_uc_import_csv_row($product_xml, $data, $store_xml) {
// Processing for each property individually
$attribute_count = 0;
foreach($data as $property => $value) {
// Firstly: Is it one of ours? ...if it begins with 'cck_'
if(!empty($value) && substr($property,0,4) == 'cck_') {
$name = substr($property,4);
if(!isset($product_xml->fields)) {
$product_xml->addChild('fields');
}
$field = $product_xml->fields->addchild('field');
$field->addchild('name',$name);
$delta = $field->addchild('delta');
$delta->addchild('value',$value);
}
}
}
Probably a lot of things which are not taken proper care of XML-wise, but it works (for us anyway)
We can now import csv-files (generated by NeoOffice) into custom product classes (with around 30 fields) in UberCart.
Erlend Strømsvik
Ny Media AS
erlend@nymedia.no