VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: Joseph Kwan on April 04, 2007, 01:53:57 am

Title: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on April 04, 2007, 01:53:57 am
I have added an excel file upload option to the product csv module making use of the open source PHP-ExcelReader. Most of the csv upload settings apply to this option. The only difference is the file is an .xls file and no limiters are needed. Anyone interested can download the hacked files at

http://www.expertcms.net/public_downloads/hack_Virtuemart_xls_upload.zip

Installation instructions included in the package.

IMPORTANT! Do remember to backup your files and database before hacking and testing.

UPDATED VERSION AVAILABLE at http://forum.virtuemart.net/index.php?topic=27154.msg94338#msg94338

 
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Ronald on April 07, 2007, 18:50:26 pm
Looks nice dude, I'm testing it now and it seems it works. I think many peops will like this hack!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: EyeScream on April 30, 2007, 15:58:43 pm
Wow!
Damn... This is a serious timesaver!
I usually do the following, when importing products:
1, I import my CSV file into Excel, modify it to suit my needs and save it as an Excel file.
2, I open the Excel file in Open Office (to be able to export with custom delimiters).
3, I export the file to a CSV file and import it into VM.

Now, I just save the file as an Excel file and import it! Sweet!

This hack should be getting a first class ticket into the next release of VM!

Ok... Gotta go... I´m running out of exclamation marks...
 ;D

Thanks, Joseph!

/..EyeScream
Title: Re: Adding Excel File Upload option to product_csv module
Post by: pcinvent on April 30, 2007, 20:57:56 pm
Fantastic hack. Highly Recommend to be integrated into standard VirtueMart Packages!!! ;)
Title: Re: Adding Excel File Upload option to product_csv module
Post by: pcinvent on April 30, 2007, 21:32:18 pm
In the English.php language file, the varible of  $_PHPSHOP_PRODUCT_CSV_UPLOAD are duplicated.
It will generated the error.
Please check and correct the  file for this line:
var $_PHPSHOP_PRODUCT_CSV_UPLOAD = 'CSV/Excel File upload';
Title: Re: Adding Excel File Upload option to product_csv module
Post by: pcinvent on April 30, 2007, 21:40:55 pm
Error shows after Upload. Doesn't work!
"Error: Mime type not accepted. Type for file uploaded: application/x-msexcel"
 ???
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 01, 2007, 06:32:06 am
The duplicate var does not generate error at least in my version of PHP. I think it is better to put all the language in one place. Go ahead to delete the duplicate entry if it caused problem for you.

Please add the line
    'application/x-msexcel',
to line 1152 in ps_csv.php if you have mime type problem.


Cheers,
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: workerb on May 09, 2007, 07:08:01 am
I followed the instructions and when I went to upload the xls file I recieved an error:
Error: File Extension not allowed. Valid extensions are: csv, txt

I am using Regular upload and "use column headers as configuration" and I upload from my HD.

I'm not sure what to do next or how to trouble shoot this.

Thanks
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 09, 2007, 07:29:33 am
Make sure the file class/ps_csv.php is replaced. Lines 1139-1142 of this file should be

      $allowed_suffixes_arr = array(
      0=> 'csv'
      ,1 => 'txt'
      ,2 => 'xls'
      // add more here if needed
      );

Joseph
Title: Re: Adding Excel File Upload option to product_csv
Post by: groentjie on May 09, 2007, 09:38:19 am
I have installed the hack but now if I go to VM is shows this (http://www.elsevier-vdu.nl/images/Naamloos-1.jpg)

what's wrong?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 09, 2007, 18:26:28 pm
Looks like you are having problem with the language file. Try comment out line 1887 of language/english.php. Let me know this solves the problem and also your OS and php version.

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: groentjie on May 09, 2007, 21:55:00 pm
in my english.php it looks like this:

1885 /*
1886   Customized language for XLS upload
1887 */
1888   var $_PHPSHOP_PRODUCT_CSV_UPLOAD = 'CSV/Excel File upload';
1889   var $_PHPSHOP_CSV_FILE_FORMAT = 'File Upload Format';

What line needs to be commented out?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 09, 2007, 21:59:11 pm
line 1888
Title: Re: Adding Excel File Upload option to product_csv module
Post by: groentjie on May 09, 2007, 22:15:05 pm
Ok, I added the dutch language in VM, because that was my default language in the normal site. So the first error is gone, but when I press csv then this error appears:

* Checks the field for existing value, if not set the default value if allowed */ function ValidateCSVInput($fieldname) { global $data, $ps_csv; if (isset($ps_csv->csv_fields[$fieldname])) { if (!empty($data[$ps_csv->csv_fields[$fieldname]["ordering"]-1])) { $this->$fieldname = trim($data[$ps_csv->csv_fields[$fieldname]["ordering"]-1]); } else if (!$ps_csv->skip_default_value) { $this->$fieldname = $ps_csv->csv_fields[$fieldname]["default_value"]; } } } function get_product_type_id() { $db = new ps_DB; $q = "SELECT product_type_id FROM #__{vm}_product_type "; $q .= "WHERE product_type_name='".$this->product_type_name."' "; $db->query($q); $this->product_type_id = $db->f("product_type_id"); } function get_product_type_name() { $this->ValidateCSVInput("product_type_name"); } function get_product_type_parameter_name() { $this->ValidateCSVInput("product_type_parameter_name"); } function get_product_type_parameter_label() { $this->ValidateCSVInput("product_type_parameter_label"); } function get_product_type_parameter_description() { $this->ValidateCSVInput("product_type_parameter_description"); } function get_product_type_parameter_type() { $this->ValidateCSVInput("product_type_parameter_type"); } function get_product_type_parameter_old_type() { $db = new ps_DB(); if ($this->product_type_parameter_name) { $q = "SELECT parameter_type FROM #__{vm}_product_type_parameter "; $q .= "WHERE parameter_name='".$this->product_type_parameter_name."' "; $q .= "AND product_type_id = ".$this->product_type_id; $db->query($q); $this->product_type_parameter_old_type = $db->f("parameter_type"); } } function get_product_type_parameter_values() { $this->ValidateCSVInput("product_type_parameter_values"); } function get_product_type_parameter_multiselect() { $this->ValidateCSVInput("product_type_parameter_multiselect"); } function get_product_type_parameter_default() { $this->ValidateCSVInput("product_type_parameter_default"); } function get_product_type_parameter_unit() { $this->ValidateCSVInput("product_type_parameter_unit"); } function get_product_type_parameter_list_order() { $this->ValidateCSVInput("product_type_parameter_list_order"); if ($this->product_type_id) { $db = new ps_DB; $q = "SELECT parameter_list_order FROM #__{vm}_product_type_parameter "; $q .= "WHERE product_type_id=".$this->product_type_id." "; $q .= "AND parameter_name = '".$this->product_type_parameter_name."'"; $db->query($q); $this->product_type_list_order = $db->f("parameter_list_order"); } } } ?>
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 09, 2007, 22:55:46 pm
Do you make it work for English? I think it's better to make sure it works with English before trying other language.

Joseph
Title: Re: Adding Excel File Upload option to product_csv
Post by: Anthony on May 24, 2007, 05:04:11 am
Ok... what am I doing wrong here? I get this any time i try to upload the xls file.

Warning: Invalid argument supplied for foreach() in /home/bdesigns/public_html/blainedistribution/store/administrator/components/com_virtuemart/html/product.mycsv.php on line 105

I've tried saving in 97-2003 workbook XLS format, 5.0 /95, and the XLSX format.

I get a similar error with CSV files as well:

Warning: Invalid argument supplied for foreach() in /home/bdesigns/public_html/blainedistribution/store/administrator/components/com_virtuemart/classes/ps_csv.php on line 2194

Line 1: Product SKU not specified
Line 2: Product SKU not specified
Line 3: Product SKU not specified

The funny thing with the CSV format is that it "previews" just fine... just wont upload correctly after previewing it.

Help?! :-)
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 24, 2007, 05:25:24 am
It may help if you can supply some sample excel file.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Anthony on May 25, 2007, 00:53:54 am
Forgive me... but how would you like the sample excel file? Copy and pasted from Excel or notepad? there is no way to upload the XLS file here.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 25, 2007, 01:13:17 am
You can put your file in a public accessible place and place a link here.
Joseph
Title: Re: Adding Excel File Upload option to product_csv
Post by: Anthony on May 25, 2007, 01:22:49 am
HA... I'm a moron. Here's a link:

http://yodadrive.mypsh.com/drives/parallelworlds/ex/97.xls (http://yodadrive.mypsh.com/drives/parallelworlds/ex/97.xls)
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 25, 2007, 09:11:33 am
Anthony,
I have no problem uploading your file. You may try uploading your file with the excel hack uninstalled. If you still have the same problem, then it has nothing to do with the hack.

Please check the version of Joomla and Virtuemart you are using. The hack is supposed to work with the latest version though probably it will work with previous versions.

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lkow77 on May 25, 2007, 22:10:43 pm
Hi All  :-)

I have a problem with upload... i have this command:

Incorrect column count
Configration: 14 fields
File: 30 fields

CSV File Imported
--------------------------------------------------------------------------------
Version: 0.7
Using delimiter:
Using enclosure:
Skipping the first line
Not skipping default value
Overwriting data
Do not use column headers for configuration
Not using preview
Doing a normal upload
Use database for configuration
Publish products field is used

I have file.xls with 30 columns (not all are with data) so, what is wrong??
In configuration I have 30 rows and 14 or 15 are marked as fields required... when I add file with 14 columns with data I have (fools? stupid data?) in my list of products..

sorry for my bad english,
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 25, 2007, 22:20:46 pm
First you have to make sure all the fields you specified are allowed. Then either
1. Specify the columns in the configuration tab in the order of the fields in the file or
2. Add the vm fieldnames to the first line of your excel file (if have some other header there, you have to replace the header). Then in the upload choose use column headers for configuration.

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lkow77 on June 02, 2007, 22:13:07 pm
Thanks for your help. I used second idea and have a problem with:
1/desc (not short but long) I C only first letter of my long desc,
2/ date start and date end discount, vm doesnt show it,
3/price - it must be net, but i want to paste to xls with tax :-)

I think that 1/ bug is, because I use other language and i dont know how to change coding in xls,
but 2/ and 3/ I haven't idea
sorry for my bad English,
I wish that U understand what do I mean,
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 03, 2007, 08:36:06 am
Can you send me your xls file?
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lkow77 on June 03, 2007, 20:39:08 pm
yes ;-)

here u r

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 04, 2007, 01:07:22 am
For your question no. 1, I can see all the text after upload. I think you must have your database set to the correct encoding before you can show international characters. I recommend using utf-8.
Question no. 2 relates to display problem. You may be able to show that by customizing the flypage.php template.
I'm not too sure about your problem 3. You can always convert the before tax and after tax price using excel before upload. That shouldn't be a big problem.
Hope this helps.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lkow77 on June 04, 2007, 01:17:32 am
sorry,
problem nr 2/
 in vm' admin in dicount list I C only for eg. 5% but without date start and end, can't convert it to discount list..

Now I have utf-8 I check it.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: juicyfruit on June 11, 2007, 08:52:27 am
Hi Joseph,

 Thanks for the component.

 question:
Can the component be used to export data?

Normally, I export data from the database before modifying the details and then import it back to the database.

cheers
Eddie
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 11, 2007, 08:59:35 am
No, the mod cannot write directly to xls files. However, csv export can be read by excel, so you can just use the csv export module to export data. Modify it and then import using xls.

Joseph

Update: latest version already support xls download. The file downloaded is in fact an xml file but can be read directly by Excel.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jtruelson on June 16, 2007, 08:32:03 am
This worked beautifully until I applied the VM 1.0.11 patch.  Is there a fix? Would I dare reinstall the current hack?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 16, 2007, 09:05:20 am
Can you report detail of the problem? By comparing the files, I don't see any problem.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jtruelson on June 16, 2007, 20:54:17 pm
Solved! ;D VM was throwing a file extension not allowed error.  I re-copied xls hack over the upgraded VM installation and it seems okay now.  Thanks for the quick reply, I much prefer to not restore from my most recent VM 1.0.10 backup.

I agree with an earlier post:  This option truly deserves to be part of the VM core.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 16, 2007, 23:20:17 pm
Yes, if you just apply the 1.0.10 to 1.0.11 patch without recopying the hack file, the ps_csv.php will be overwritten and the hack will have problem. I've updated the download with a new version that should work for both 1.0.10 and 1.0.11.

Edited June 18: That means, if you want to upgrade to 1.0.11, you have to re-apply the hack after the patch. The updated version added the changes in version 1.0.11 and it should have no problem working with 1.0.10.

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Nero on June 18, 2007, 20:45:15 pm
God, my Nightmares are over, thank u  20 000 times Sir Kwan. This is the first time i manage to upload files into virtue mart, none of the CSV methode i try, for weeks and weeks did work. My compliments and yes, this should be implanted in the future update of VM !! Thanks a lot !!!

THANK U THANK U THANK U !!!!!!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on June 23, 2007, 08:21:59 am
hi,

after commenting out the duplicated items in language file, it drops this:

Quote
Parse error: syntax error, unexpected T_CLASS, expecting T_FUNCTION ... administrator\components\com_virtuemart\languages\english.php on line 1901
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 23, 2007, 08:34:12 am
Usually this problem is due to a missing ';'. Please post the line you have commented out in case you can't solve your problem.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on June 23, 2007, 09:42:22 am
Code: [Select]
var $_PHPSHOP_PRODUCT_DISPLAY_UPDATE_ITEM_LBL = 'Item Update Results';
// var $_PHPSHOP_PRODUCT_CSV_UPLOAD = 'Use CSV upload';
var $_PHPSHOP_PRODUCT_FOLDERS = 'Product Folders';
...
var $_PHPSHOP_PRODUCT_CLONE = 'Clone Product';
//var $_PHPSHOP_CSV_SETTINGS = 'Settings';
var $_PHPSHOP_CSV_DELIMITER = 'Delimiter';
var $_PHPSHOP_CSV_ENCLOSURE = 'Field Enclosure Char';
//var $_PHPSHOP_CSV_UPLOAD_FILE = 'Upload a CSV File';
var $_PHPSHOP_CSV_UPLOAD_XLS_FILE = 'Upload an EXCEL File';
//var $_PHPSHOP_CSV_SUBMIT_FILE = 'Submit CSV File';
//var $_PHPSHOP_CSV_FROM_DIRECTORY = 'Load from directory';
//var $_PHPSHOP_CSV_FROM_SERVER = 'Load CSV File from Server';
//var $_PHPSHOP_CSV_EXPORT_TO_FILE = 'Export to CSV File';
var $_PHPSHOP_CSV_SELECT_FIELD_ORDERING = 'Choose Field Ordering Type';
var $_PHPSHOP_CSV_DEFAULT_ORDERING = 'Default Ordering';
var $_PHPSHOP_CSV_CUSTOMIZED_ORDERING = 'My customized Ordering';
//var $_PHPSHOP_CSV_SUBMIT_EXPORT = 'Export all Products to CSV File';
//var $_PHPSHOP_CSV_CONFIGURATION_HEADER = 'CSV Import / Export Configuration';
var $_PHPSHOP_CSV_SAVE_CHANGES = 'Save Changes';
...

var $_PHPSHOP_CSV_AVAILABLE_FIELDS = 'Available Fields';
//var $_PHPSHOP_CSV_OUTPUT_CSV_UPLOAD_MESSAGES = 'CSV upload messages:';
var $_PHPSHOP_CSV_OUTPUT_COUNT = 'Count';
var $_PHPSHOP_CSV_OUTPUT_TOTAL = 'Total';
//var $_PHPSHOP_CSV_OUTPUT_FILE_IMPORTED = 'CSV File Imported';
var $_PHPSHOP_CSV_OUTPUT_UPDATED = 'Updated';

I've commented all the vars that can be found beneath Customized language for XLS upload coz they're duplicated
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 24, 2007, 00:17:17 am
Don't see any problem with your file. You may try using the original file from the latest version and see if that works. The customization of the language are just for easier understanding. If that works, you can then copy back the custom language element one by one.

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on June 24, 2007, 19:11:59 pm
The problem was that the vars were ended with this:
Quote
class phpShopLanguage extends vmLanguage {}
but there should have been only a } sign.
thanks for your help

Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 25, 2007, 07:25:39 am
Good to know you find the problem. Is it a problem with the download? Other people doesn't seem to have problem.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on June 25, 2007, 08:30:45 am
Yes, I've simply extracted the hack_Virtuemart_xls_upload.zip and there it is, in the language file. The modifications I had to make are commenting out the duplicated vars and in line 1902 the class phpShopLanguage extends vmLanguage {} had to be rewritten to a simple }
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 25, 2007, 08:46:57 am
That's interesting. Do you have a brace } at line 1901? The class definition should have been ended with this brace.
Line 1902 is there for compatibility purpose. If you are using virtuemart, line 1902 can be deleted.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on June 25, 2007, 08:50:19 am
ok, thank you
Title: Re: Adding Excel File Upload option to product_csv module
Post by: erick monfredo on June 25, 2007, 19:32:54 pm
Thanks this tools is exactly what i need...but i got this error :

Fatal error: Cannot redeclare vmLanguage::$_PHPSHOP_PRODUCT_CSV_UPLOAD in /var/www/vhosts/xxxxxxxxx/httpdocs/site/administrator/components/com_virtuemart/languages/english.php on line 1887

Saw ther's  alreday same problem on first page seems to be fixed..but tryed to comment line   and still same error ...

that's the original english.php file, i didn't touched anything :

Code: [Select]
Customized language for XLS upload
*/
var $_PHPSHOP_PRODUCT_CSV_UPLOAD = 'CSV/Excel File upload';
var $_PHPSHOP_CSV_FILE_FORMAT = 'File Upload Format';
var $_PHPSHOP_CSV_FORMAT_CSV = 'CSV File';
var $_PHPSHOP_CSV_FORMAT_XLS = 'EXCEL File';
var $_PHPSHOP_CSV_SETTINGS = 'CSV Settings';
var $_PHPSHOP_CSV_UPLOAD_FILE = 'Upload File';
var $_PHPSHOP_CSV_SUBMIT_FILE = 'Submit File';
var $_PHPSHOP_CSV_FROM_DIRECTORY = 'Load from directory';
var $_PHPSHOP_CSV_FROM_SERVER = 'Load File from Server';
var $_PHPSHOP_CSV_EXPORT_TO_FILE = 'Export to CSV File';
var $_PHPSHOP_CSV_SUBMIT_EXPORT = 'Export all Products to CSV File';
var $_PHPSHOP_CSV_CONFIGURATION_HEADER = 'FILE Import / Export Configuration';
var $_PHPSHOP_CSV_OUTPUT_CSV_UPLOAD_MESSAGES = 'File upload messages:';
var $_PHPSHOP_CSV_OUTPUT_FILE_IMPORTED = 'File Imported';
}

Please can u tell me what is the problem ???

Thanks

Erick
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 25, 2007, 19:50:10 pm
Look like many people have problem with the language file. Probably I need to give up the original idea of keeping the text in one place. I will do an update pretty soon.
In the mean time, you can comment out all the duplicate declarations.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 26, 2007, 07:46:02 am
File download updated with new version. Changes include
1. all duplicate declaration commented out.
2. minor adjustments in product.csv_upload.php so that default upload format is excel and use column headers as configuration is default.
The link again for easy access: http://www.expertcms.net/public_downloads/hack_Virtuemart_xls_upload.0.52.zip
This file is the same as the one on the first post though the filename is different just in case you need to track the version.

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: erick monfredo on June 26, 2007, 09:17:15 am
thanks ..thanks thanks
Title: Re: Adding Excel File Upload option to product_csv module
Post by: erick monfredo on June 26, 2007, 09:32:44 am
yep yep....think now i have another problem :

Warning: main() [function.main]: open_basedir restriction in effect. File(/oleread.inc) is not within the allowed path(s): (/var/www/vhosts/xxxxxxxxxxxx.com/httpdocs:/tmp) in /var/www/vhosts/xxxxxxxxxxxx.com/httpdocs/site/administrator/components/com_virtuemart/classes/excel/reader.php on line 4

Warning: main(oleread.inc) [function.main]: failed to open stream: Operation not permitted in /var/www/vhosts/xxxxxxxxxxxx.com/httpdocs/site/administrator/components/com_virtuemart/classes/excel/reader.php on line 4

As i'm a really newbie..can someone can explain me what is this problem?  a  temp/ path problem ?? ..becose now i cannot login to admin :(

Thanks

Erick

ok problem solved..i had to enter  the full path :)
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on June 26, 2007, 09:41:22 am
Hi! I've a little problem again. If I have such a nice xls, attached, and i try to import it in excel upload it puts everything into the first culumn

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 26, 2007, 19:30:41 pm
I have no problem uploading your file, though the text doesn't show properly maybe because of a different encoding.
Probably you are having problems of the charset. What encoding are you using?

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Shaun on June 27, 2007, 02:48:56 am
Hi Joseph

When I try to upload an excel file, I'm getting the following error...

Quote
Fatal error: Cannot instantiate non-existent class: spreadsheet_excel_reader
in administrator/components/com_virtuemart/classes/ps_xls.php on line 62

I've been using portals for years, but only just recently decided to start to learn php. I've taken a look through the file, but it still means nothing to me.

Do you know what I could have done wrong? Thanks in advance for your help
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 27, 2007, 03:51:58 am
That usually means you haven't include the required file excel/reader.php or it is not found. However, the file is designated as require already at the top of the file. If the file is not found, php should already give you an error. So I feel somewhat strange.

Anyway, check that the file excel/reader.php is there and that it contains the class spreadsheet_excel_reader. If not, you may have to copy it from the download file.

Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Shaun on June 27, 2007, 17:00:18 pm
Thanks Joseph

excel/reader.php was there in the structure, but didn't include the class. I downloaded speadsheet_excel_reader from (I think) sourceforge - which is attached to this post - and has now solved the problem.

The layout is now completely wrong (images covering the product name), but thats a post for a different section!! Thanks again

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 27, 2007, 18:23:16 pm
That's something strange. I've checked my download link. The reader file is there and it contains the class!
Anyway, if you update the product_full_image field, the image link of course will be wrong. By using CSV/XLS import, you have to do the image file upload manually.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on June 29, 2007, 21:54:20 pm
Function Not Registered. product_xls is not a valid MOS_com_phpShop function.
+
Invalid argument supplied for foreach() in ...administrator\components\com_virtuemart\html\product.mycsv.php on line 105
+
Invalid argument supplied for foreach() in ...administrator\components\com_virtuemart\html\product.mycsv.php on line 116


I've tried to upload an xls...
What does it mean?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 29, 2007, 22:23:10 pm
you need to add the function to the module list. see readme of the download.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on July 01, 2007, 13:11:29 pm
Could I export (and import) the content of jos_vm_product_type_1 table? When I chose from the possible fields non of them was this one. This table would be important because this contains the parameters of each product that can be found by the special search. So it would be really good if these values could be imported from the excel file with the products.
Now without this option when I import the xls I have to add product type for every single product and than every parameter of the product type has to be set manually from product to product. This would be much faster in excel.

Do you know any solution? Was I lame that I couldn't export these values?

thanks
lipmat
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 02, 2007, 00:43:26 am
While I am not familiar with product type (I've never used it), it seems possible to upload product type, product type parameters and product type detail using the csv.
You may want to do some research/experiment with the these. The options can be set in CSV Import/Export Upload settings. Choose the appropriate upload in the select box.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lipmat on July 02, 2007, 09:35:09 am
I did so. But these options resulted empty columns (rather strange because sg should have been shown in these columns eg. the products' type or sg else...). That's why I think they're not the ones I need. Actually I think it's not so simple, because on exporting columns have to be automatically added to the pre-chosen ones because a php script has to find out in which product types is the product included (as far as i know more types can be selected for one product) and has to find out the number of options of each product type. This "number" columns will be added.

I'll try to do something about it...
(I'm a beginner at php programming so don't expect much... :) )
Title: Re: Adding Excel File Upload option to product_csv
Post by: matthieu on July 04, 2007, 01:57:46 am
I tried the first version of the file. It works but I have two problems:
 - On excel, product_desc contain accent (like é or à,...) and when I Upload the excel file, the first accentuated letter and the next ones are not uploaded in the data base.
 - The problem you spoke joseph on your last post on the image : On excel, i put the name of the picture. I put this one on the folder (com_virtuemart/shop_image/product) and it does not work, have you a solution?

Thanks

My excel file http://esnips.com/web/joomla-temp (http://esnips.com/web/joomla-temp)

Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 04, 2007, 02:10:21 am
For non-ASCII characters, make sure you database and your pages are in correct encoding.
For images, I'm not sure about your question. But from your excel file, you didn't specify the values for product_full_image which is the primary file. You need to have both the full image and thumb_image to have the image system works.
Joseph
Title: Re: Adding Excel File Upload option to product_csv
Post by: matthieu on July 04, 2007, 08:50:36 am
thanks for your answer. Concerning the non ASCII characters, when i manualy add a product with accent on product_desc, it works : every characters are in the database and on the website.

http://grimaud.celeonet.fr/component/page,shop.product_details/flypage,shop.flypage/product_id,14/category_id,6/manufacturer_id,0/option,com_virtuemart/Itemid,1/ (http://grimaud.celeonet.fr/component/page,shop.product_details/flypage,shop.flypage/product_id,14/category_id,6/manufacturer_id,0/option,com_virtuemart/Itemid,1/)
Title: Re: Adding Excel File Upload option to product_csv module
Post by: matthieu on July 04, 2007, 14:06:06 pm
you are right : some of accentuated characters of my excel file pose a problem although i did a copy paste of excel by only keeping the values(special paste).
How can i modify the excel encoding?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 04, 2007, 18:43:33 pm
I uploaded your file to my test site and found all (or at least some) of the accentuated cahracters are there. So I'm quite sure that is an encoding problem.
I guess recent Excel versions all use unicode. So, maybe you can try setting your database to utf-8 and page encoding to utf-8 to see if it works.
Joseph
Title: Re: Adding Excel File Upload option to product_csv module
Post by: matthieu on July 06, 2007, 15:37:37 pm
thanks for your help joseph, I did not succeed to resolve my problem, so I gave the CSV method and it is okay now.

Thank you to gave time to answer my responses, your application is very nice!!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Paul Humberstone on July 10, 2007, 05:23:17 am
Hi Joseph,

I’m new to VirtueMart, PHP etc and I’m having difficulty with my csv/xls upload. I’ve installed your hack and was wondering if you might be able to help?

The file I ultimately want to upload daily is http://www.itproducts.net.au/HelpMe/PC070710.txt

For my initial test data I downloaded the sample data test file that came with VirtueMart
http://www.itproducts.net.au/HelpMe/CSV_Export_10-07-2007_12.33.csv

Saved it as an xls file
http://www.itproducts.net.au/HelpMe/CSV_Export_10-07-2007_12.33.xls

and tried to import it using these settings
http://www.itproducts.net.au/HelpMe/xls_upload_settings.bmp

I got these results
http://www.itproducts.net.au/HelpMe/xls_upload_results.bmp

I then tried with the below test data
http://www.itproducts.net.au/HelpMe/Test.xls

and got this message

Notice: Undefined offset: 2 in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 2478

Notice: Undefined offset: 21 in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 2478

Notice: Undefined offset: 23 in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 2478

Notice: Undefined offset: 22 in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 2478

Notice: Undefined offset: 24 in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 2478

Notice: Undefined offset: 17 in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 2478

Notice: Undefined offset: 15 in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 2478

Any help would be greatly appreciated,

Cheers,

Humbie.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 10, 2007, 06:45:59 am
Paul,
The first excel file contains extra characters ~ (which is the separator for CSV download). You have to clean it up first (just make a global replace) before using it for upload.
The second excel file contains some blank cells and so caused php notices. PHP notice doesn't cause problems and can be ignored. (they should be turned off by default but your php setting happens to thave that on). Your upload of the second excel file should be OK.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jcaan on July 10, 2007, 17:30:09 pm
Hi. I am trying very hard to understand and configure my products with child items. I have setup an excel file with the following headers:

product_sku
product_s_desc   
product_desc   
product_in_stock   
product_available_date   
product_name   
product_price   
product_thumb_image   
product_full_image   
product_weight   
product_length   
product_width   
product_height   
category_path   
manufacturer_id   
product_tax_id
product_parent_sku
attribute
attributes   
attribute_values
product_availability   
product_special
product_publish
product_discount
product_discount_date_start
product_discount_date_end

As an example, For parent products I have specified 0 price and for child items I have specified it as metal::32|plastic::10 in the attribute_values column (in excel). The atrributes column has metal::1|plastic::2

I have product_sku column as B12 (My SKU Value) and for parent_product_sku I have B12.

When I upload I dont see any attributes for the parent product save for a 0 price. What I am doing wrong? Can someone please send me an example excel file with how the column configuration should be. Please help.


Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 11, 2007, 06:59:08 am
In order to help first-time user, I've included a sample.xls in the download. For those just need the sample.xls, the file is attached.

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jcaan on July 11, 2007, 10:32:46 am
Thanks JK. Good stuff.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Paul Humberstone on July 12, 2007, 05:26:47 am
Hi Joseph, thanks for your help but I'm still having problems uploading even using the sample.xls you provided.

Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 314

Warning: Invalid argument supplied for foreach() in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 258

Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 314

Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 314

Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 314

Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 314

Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /clientdata/clients/i/t/itproducts.net.au/www/administrator/components/com_virtuemart/classes/ps_csv.php on line 314

What settings should I be using here? http://www.itproducts.net.au/HelpMe/settings.bmp

Cheers,

Paul.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 12, 2007, 05:32:43 am
Look like you are not using excel upload. Check Excel for the file format. Check Use Column Header as Configuration.
Title: Re: Adding Excel File Upload option to product_csv
Post by: Paul Humberstone on July 12, 2007, 06:18:29 am
Sorry Joseph but where do I check Excel for the file format? I can't seem to find that as an option?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 12, 2007, 06:22:44 am
I'm sorry I didn't recognize that earlier. Did you install the hack which you can find in the first post on page 1?
Title: Re: Adding Excel File Upload option to product_csv
Post by: Paul Humberstone on July 12, 2007, 06:33:59 am
Joseph,

I'm pretty sure I've installed the hack correctly http://www.itproducts.net.au/HelpMe/ps_xls_setup.bmp

Cheers,

Paul.
Title: Re: Adding Excel File Upload option to product_csv
Post by: Paul Humberstone on July 12, 2007, 06:41:18 am
Thanks Joseph I got it! I reinstalled the hack using version hack_Virtuemart_xls_upload.0.52.

Thanks very much for your help, Paul.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jcaan on July 12, 2007, 15:45:04 pm
Hi. I uploaded the sample xls. But Im sorry to say it still doesn't create child products. The child products end up on the main product list without the category showing. Please help.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jcaan on July 15, 2007, 05:09:54 am
My problem is now solved. Ive been searching the forums until I found this thread solved by Pisu regarding the issues with creating Child Items.

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=26131.0

Remember to backup your file first.

So from the above thread I downloaded the ps_csv.zip and extracted it to: administrator\components\com_virtuemart\classes directory overwriting the ps_csv.php file.

Now in the CSV/Excel upload in backend of VM, if you try uploading the sample.xls supplied by Joseph Kwan in earlier posts you will get the following error:

Error: File Extension not allowed. Valid extensions are: csv, txt

As Joseph Kwan pointed out before in earlier threads, modify the ps_csv.php as described below:

open ps_csv.php

On Lines 1139-1142 (you have to scroll down a little bit) of this file should be

      $allowed_suffixes_arr = array(
      0=> 'csv'
      ,1 => 'txt'
      ,2 => 'xls'
      // add more here if needed
      );

Now when I uploaded the sample.xls file again, I can now see products having child items. It worked a charm. Many thanks.
Title: Re: Adding Excel File Upload option to product_csv
Post by: Tearstone on July 16, 2007, 01:00:49 am
This works great so far!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Morten Frederiksen on July 19, 2007, 13:14:10 pm
Hi

I'm kind a "newbie" in this so I was a little confused by the readme.hack_virtuemart_xls_upload file.

In the file it says:

Select Administraton/Modules/List Modules
In the Product List, click List in the Product module row.
3. Click New to create a new function with the following info:

But the info names did'nt match so I tried to

Select Administraton/Function/List functions
In the Function List, click List in the Function module row.
3. Click New to create a new function with the following info:
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Morten Frederiksen on July 19, 2007, 13:15:49 pm
And by the way - I used the 0.52 - but there is still a problem with languge - is that right?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 19, 2007, 16:46:22 pm
You must start from Modules/List Modules first. Otherwise you won't reach List Functions menu. But if you are using a different language, the naming may be different.

The language file should be OK. If you have problem, please post your error.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: dagnome on July 25, 2007, 06:29:10 am
BRAVO JOSEPH!  :D :D :D :D :D :D :D

This took all of about 10 minutes to install, even being careful with the FTP upload and it worked like a charm!
Wish I had found this 8 hours ago!

many thanks! ~ Bruce
Title: Re: Adding Excel File Upload option to product_csv
Post by: teaboy on July 26, 2007, 15:55:30 pm
Joseph, that's magic - this is going to save us an unbelievable amount of sodding about with CSVs, delimiters etc. Simple genius. Donation coming your way!

Cheers

Teaboy
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on July 26, 2007, 16:27:34 pm
I installed this hack, and everything work fine except one thing.
Site is encoded in UTF-8
When I imported file.xls, the special characters like, č, š, ć,...it break the word, example the word "pločice" will be written like "plo".
I can manually correct the problem. Enter into products details and change what I need. But...
How can I set up correct encoding in my database, because all site is already in utf-8
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 26, 2007, 17:42:08 pm
Yes, the current version does not support utf-8. I will be updating the files soon with one that does. I need some more testing though. But using utf-8 will need iconv or mbstring, please make sure you have that ready.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on July 27, 2007, 13:21:46 pm
Can I use this spec. characters on the other way, ex. changing encoding of all site?

I trying to synchronize (daily) my local database with VM database on web site, but if I must change this characters manually, it will be very frustrating and long process.

I will be very thankfull for any kind of help in solving this problem.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 27, 2007, 19:19:00 pm
No. the hack only handles upload, not encoding conversion.

One way you may consider is export your database to a file and then do the conversion on the exported file using some conversion tool (just copy and paste may work if your source file and destination file are in the correct encoding.) Import the database back into your destination server after conversion.

This assumes you understand fully what you are going to do. If not, you better find someone knowledgeable to do it.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jcaan on July 30, 2007, 17:09:10 pm
Hi. I must say that this excel hack is simple awesome. I have uploaded 900+ products via excel XLS file. I have about 500+ products, and many of them have child items. One problem Im facing is that everytime I upload and overwrite existing data, all products with child items dont appear normal e.g: on the standard flypage

Product 1
Please select an item:
Item Name1 - - $100
Item Name2 - - $120

If I empty the database and upload the same file again, correct values appear e.g:

Product 1
Please select an item:
Item Name1 - Material (Chrome) - $100
Item Name2 - Material (Gold) - $120

Can someone please tell me why this happens and is there a way I can reset the products child items from database level without having to Empty the database and upload everytime a new product comes in.

Please help.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on July 30, 2007, 17:19:09 pm
Joseph,
I look around and found in
administrator/components/com_virtuemart/classes/ps_xls.php (about line 63. something like $this->xls->setOutputEncoding('CP1251'); ) and just change to
$this->xls->setOutputEncoding('UTF-8');

and it's work. :-).

Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 30, 2007, 19:22:30 pm
Thanks Marco.

Yes, this works for some systems which has iconv installed. For systems which don't have iconv, this does not work even if they have mbstring. And there are some issues such as
1. Hard coding the encoding will presume utf-8, some user may prefer some other encoding.
2. Conversion will not be done if iconv and mbstring are not installed.

I am working on a update which will detect the encoding automatically and the existence of the conversion fucntion. Meanwhile, you may try Marko's solution to see if this fits your need. You can always revert back if it doesn't work.

Title: Re: Adding Excel File Upload option to product_csv module
Post by: lazyNode on August 02, 2007, 03:29:52 am
Worked beautifully.

This is what I have:
VirtualMart 1.0.12
Joomla 1.0.13
Excel 2007 12.0.6024.5000
XP Pro

I added my data into the provided sample.xls and uploaded it. Simple and easy. So far so good. All I wanted was a simple category management, as I'm not even using the online shopping components. Thanks!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Moog on August 12, 2007, 16:58:21 pm
How can I add image link to the thumbnail and full image area ? If I add the location http://www.domain.com/asd.jpg then it doesn't work.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on August 12, 2007, 17:30:02 pm
If your image is located on your server, just use  "asd.jpg" in both the product_full_image and product_thumb_image column. Also, enable dynamic thumbnail resizing in your VM configuration / Layout..
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Moog on August 12, 2007, 21:06:15 pm
Ok thanks. But possible to add url and then saves picture ?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on August 13, 2007, 00:24:54 am
If you mean adding pictures from an external server, yes and no.
You can add url of pictures from external server. But the picture will not be downloaded to your server. And the thumbnail dynamic resizing will not work.
Title: Re: Adding Excel File Upload option to product_csv
Post by: Moog on August 13, 2007, 13:24:22 pm
If you mean adding pictures from an external server, yes and no.
You can add url of pictures from external server. But the picture will not be downloaded to your server. And the thumbnail dynamic resizing will not work.

Thanks for the exact answer.
Title: Re: Adding Excel File Upload option to product_csv
Post by: dan on August 13, 2007, 13:38:15 pm
does any one know if this xls hack works with the shopper group hack seen here: http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=4500.0

I really need this option and am willing to pay if someone can help,

Many thanks
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Paulo on August 21, 2007, 21:17:52 pm
hi guys.
I tried to install this hack at virtuemart 1.0.12, and i gess i did everything right. I copied the files to administrator folder (in com_virtuemart directory) and then created the list at virtuemart administration.
Because I didn't saw any new menu i tried to upload the sample file included. But it says:
Error: File Extension not allowed. Valid extensions are: csv, txt

Does it not work in this version?
 ???
Title: Re: Adding Excel File Upload option to product_csv
Post by: Paulo on August 21, 2007, 21:37:32 pm
and i checked.. the ps_csv.php file was uploaded correctly :S
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Paulo on August 21, 2007, 23:31:35 pm
guys.. finally managed to get it working.. but it still gives an error. I'm just trying to upload the sample file... Nothing more!

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv
Post by: Paulo on August 21, 2007, 23:52:59 pm
anyone
»?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: thomas_freeman on August 22, 2007, 03:58:32 am
Paulo, turn on your debug and see if it gives you any more info.
Title: Re: Adding Excel File Upload option to product_csv
Post by: Paulo on August 22, 2007, 15:48:53 pm
hi. i figured out.. Been despered turned out good. don't ask me why but it seems all the files weren't copied to the server. so it couldn't work out good. I had to go to the server and delete one by one and then upload the hacked ones.
I noticed that on the menu it had "upload CSV" and then changed to "upload cvs/excel". And all started to work. Right now I go to the same menu and it shows again only "Upload Csv". But still works.. LOL don't mind!
Title: Re: Adding Excel File Upload option to product_csv
Post by: lazyNode on August 22, 2007, 16:01:18 pm
OK now I've run into a wierd error. When I add a new item to the spreadsheet, then upload it, I get a blank screen instead of upload successful screen.

I go to delete the new item from the xls and retry, and it uploads fine.

To test I am not entering corrupt information. I copy/paste an item existing in the spreadsheet, modify the product_sku # and product_parent_sku #to make it look like a new item. Upload and blank screen again.

I only have 579 items.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on August 23, 2007, 02:23:03 am
The most probable cause for a blank screen is php error. Try turn on error reporting in your Joomla Configuration/Server. If you still get a blank screen, post your excel file here.
Title: Re: Adding Excel File Upload option to product_csv
Post by: lazyNode on August 23, 2007, 13:53:00 pm
Yeah I tried turning on both the debug function on and the error_reporting (0), and it still ends up blank.

This is the file (file removed by user)
The last 3 items are the test duplicates. I notice when I change the sku and parent_sku values to 777test, 789test and 790test the file will upload ok.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lazyNode on August 24, 2007, 04:57:01 am
OK, I duplicated the site onto my local server and tried uploading the same file. i get this:

C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_database.php:111
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_csv.php:1585
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_csv.php:596
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_xls.php:118
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_xls.php:88
C:\Program Files\Apache2.2\htdocs\Kays\components\com_virtuemart\virtuemart_parser.php(268) : eval()'d code:1
C:\Program Files\Apache2.2\htdocs\Kays\components\com_virtuemart\virtuemart_parser.php:268
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\admin.virtuemart.php:59
C:\Program Files\Apache2.2\htdocs\Kays\administrator\index2.php:69
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on August 24, 2007, 07:15:57 am
I understand why you have a blank screen now. It's because a bug in reader.php which turn off the error reporting. And then the problem line is another bug in ps_csv.php. However, I still don't know what data in the xls file caused the bug to occur.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: lazyNode on August 24, 2007, 09:46:20 am
I should add that I have installed a hotfix for VirtueMart/Joomla
Both the official fix and Sorens-Joomla!_1.0.13_SessionFix.zip.
Along with using mod_virtuemart_luckyphoto_1.0.tar.gz
But those should not affect this application.

The error only sometimes occurs, so for the time being until we find a solution, I can manually add new products via Virtuemarts GUI. And then later edit them in the csv. (That way it still uploads)

Thanks for having a look!
Title: Re: Adding Excel File Upload option to product_csv
Post by: lazyNode on August 29, 2007, 07:29:22 am
OK here is further testing of my upload error.
The xls uploads ok to my live http site.

However, when I try uploading the file to my duplicate site on my PC server, I get the following error:

Code: [Select]
INSERT INTO jos_vm_category (vendor_id,category_name, category_publish,cdate,mdate,list_order) VALUES ('1', 'Pressure Filter with UV's', 'Y', '1188363775', '1188363775', '6')


C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_database.php:111
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_csv.php:1105
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_csv.php:2076
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_csv.php:572
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_xls.php:118
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_xls.php:88
C:\Program Files\Apache2.2\htdocs\Kays\components\com_virtuemart\virtuemart_parser.php(268) : eval()'d code:1
C:\Program Files\Apache2.2\htdocs\Kays\components\com_virtuemart\virtuemart_parser.php:268
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\admin.virtuemart.php:59
C:\Program Files\Apache2.2\htdocs\Kays\administrator\index2.php:69


OK, So I see that the apostrophe (') in 'Pressure Filter with UV's' might be causing the problem.
So I delete all the (') and try uploading to my home server again.


Now this error pops up:
Code: [Select]
INSERT INTO jos_vm_product (cdate,mdate,vendor_id,product_sku, product_s_desc, product_desc, product_thumb_image, product_full_image, product_weight, product_weight_uom, product_length, product_width, product_height, product_lwh_uom, product_in_stock, product_available_date, product_discount_id, product_discount_id, product_name, product_sales, attribute, custom_attribute, product_publish) VALUES ('','','1','632', 'pond feeder with battery operated timer for regular feeding. (battery included)', '', 'ead431f0b2224145641744a279be27d5.jpg', 'fd084ae9e156d3979eeadd5d063fc135.jpg', '0', 'pounds', '0', '0', '0', 'inches', '0', '-36000', '0', '0', 'N-PFEEDER', '0', '', '', 'Y')


C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_database.php:111
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_csv.php:1585
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_csv.php:596
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_xls.php:118
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\classes\ps_xls.php:88
C:\Program Files\Apache2.2\htdocs\Kays\components\com_virtuemart\virtuemart_parser.php(268) : eval()'d code:1
C:\Program Files\Apache2.2\htdocs\Kays\components\com_virtuemart\virtuemart_parser.php:268
C:\Program Files\Apache2.2\htdocs\Kays\administrator\components\com_virtuemart\admin.virtuemart.php:59
C:\Program Files\Apache2.2\htdocs\Kays\administrator\index2.php:69

When I tick "Collect debug information" then I just get a plain blank screen without the above errors.
This is my xls file without the apostaphes. http://petras.com.au/wed2.xls (http://petras.com.au/wed2.xls)
I hope that this might help you with de-bugging,
Thanks Joseph.

It's still a great function.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Bud on September 01, 2007, 00:26:34 am
Hi Joseph,

I have uploaded the examples sheet you have provided successfully.

I want to know an easy method to get the product description(in HTML) to one excel cell.

Say I have the product description in a word doc and I want to convert it to HTML and then to one excel cell as per your example.

Cheers

Bud
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 01, 2007, 01:09:30 am
It depends on how you prepare your html. If you use a plain text editor, you can copy and paste the html code into excel (paste to the textbox above, not into the cell. Hope you see what I mean).
It's not recommended you use MS word to prepare html. And it may not be easy to paste html code from word into excel.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Bud on September 01, 2007, 03:13:32 am
Thanks for the quick reply Joseph.

Yes, I managed to do it as you mentioned.

Is it easy to convert some text into a html code using a simple Text editor?

I used the JCE editor in Joomla and got the html code.

Cheers

Bud
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 01, 2007, 03:35:07 am
There are some well-designed open source plain text editor which helps to edit html as well as many otherprogramming languages. You can check out SCITE http://www.scintilla.org/SciTE.html.

JCE is also a very nice html editor. The only drawback is it's not working fast enough.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: BenDover on September 13, 2007, 00:09:14 am
Hé, I got the exact same problem as lazyNode.
When I add a new product in excel the file will not upload (blank screen)
It can only update products which are already present in virtuemart.

For extra info:
I have the exact same problem with CVS upload so I went to this XLS upload.
I got this error message when I upload it with CVS, it's a SKU problem I think.
Fatal error: Cannot break/continue 1 level in  ………administrator/components/com_virtuemart/classes/ps_csv.php on line 599

Line 599 = continue;

/*************************************************
** SKU does not exist - add new product **********
** Add product information ***********************
*************************************************/
if (!$this->ProductQuery("add")) {
$d['csv_stats']['incorrect']['message'] .= "Line $this->line: <strong>Incorrect</strong> Product SKU: $product_details->product_sku could not be added<br />";
$d['csv_stats']['incorrect']['count']++;
continue;
               }
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 13, 2007, 00:23:31 am
That's a bug in VM. Try replacing 'continue' by 'return false'
However, it doesn't fix the problem. It only removes the error.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: BenDover on September 13, 2007, 00:43:55 am
Hi Joseph,
I replaced it and now the excel import finish with this File Upload message:
Line 7: Incorrect Product SKU: 7 could not be added

But the big question is, why can't I add new products with CVS/Excel import?

Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 13, 2007, 01:10:05 am
There's an SQL problem Turn debug site on in Joomla Configuraton and post the SQL string that starts with
INSERT INTO jos_vm_product
Title: Re: Adding Excel File Upload option to product_csv module
Post by: BenDover on September 13, 2007, 01:58:56 am
I get this message at top now when turning on debug after uploading:

Notice: Undefined variable: errlevel in /usr/home/web/snl149285/administrator/components/com_virtuemart/classes/excel/reader.php on line 210


Extra info:
With PHPMyAdmin I can export the products as a CVS file, add a product in a text file and then import it again with PHPMyAdmin.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 13, 2007, 02:16:08 am
The notice is not a big problem. If debug site turned on, you should see a series of sql statements at the bottom of the page. I just want to see the query that do the insert which starts with

INSERT INTO jos_vm_product (cdate, mdate, vendorid ...
Title: Re: Adding Excel File Upload option to product_csv module
Post by: hmmurdock on September 13, 2007, 05:18:03 am
I was able to install the hack fine, but when I go to upload it simply goes a blank page and hangs. The url is administrator/index2.php

The preview I did in IE worked fine, and when I continued to upload is when it hang. When I tried to preview in Firefox, it went right to the blank page.

Any advice is GREATLY appreciated, thanks!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 13, 2007, 05:29:10 am
Please post your excel file.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: BenDover on September 13, 2007, 11:01:29 am
Hi Joseph,
For test I have 6 products in VM, in excel file now 7 products.
7th product not added: Line 7: Incorrect Product SKU: 7 could not be added

This is the sql string for 7th product when I upload it:
INSERT INTO #__{vm}_product (cdate,mdate,vendor_id,product_sku, product_s_desc, product_desc, product_thumb_image, product_full_image, product_weight, product_weight_uom, product_length, product_width, product_height, product_lwh_uom, product_in_stock, product_available_date, product_discount_id, product_discount_id, product_name, product_sales, attribute, custom_attribute, product_tax_id, product_publish) VALUES ('','','1','7', '', '<strong>Printformaat:</strong><br />80x200 cm tweezijdig<br /><br /><strong>Kleur:</strong><br />zilver<br /><br />De roll-up is gemaakt uit aluminium. inclusief dubbele full-color print op PVC.', '34c0a4587d60de83d3610938e0d63919.jpg', 'bfdaa47960e00d395a9da44268ca517f.jpg', '0', 'pounds', '0', '0', '0', 'inches', '0', '1189288800', '0', '0', 'Roll-up luxe dubbel', '0', '', '', '2', 'Y')

For reference, this is the update sql for 6th product, this is working (Line 6: Updated Product SKU: 6):
UPDATE #__{vm}_product SET product_sku = '6', product_s_desc = '', product_desc = '<strong>Printformaat:</strong><br />80x200 cm tweezijdig<br /><br /><strong>Kleur:</strong><br />zilver<br /><br />De roll-up is gemaakt uit aluminium. inclusief dubbele full-color print op PVC.', product_thumb_image = '34c0a4587d60de83d3610938e0d63919.jpg', product_full_image = 'bfdaa47960e00d395a9da44268ca517f.jpg', product_weight = '0', product_weight_uom = 'pounds', product_length = '0', product_width = '0', product_height = '0', product_lwh_uom = 'inches', product_in_stock = '0', product_available_date = '1189288800', product_discount_id = '0', product_discount_id = '0', product_name = 'Roll-up luxe dubbel', product_sales = '0', attribute = '', custom_attribute = '', product_tax_id = '2', mdate='' , product_publish ='Y' WHERE product_sku='6'
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 13, 2007, 19:14:19 pm
Thanks for the posting. This helps to clarify the problem, finally. The problem is an extra "product_discount" column in addition to the "product_discount_id" column. The code is intelligent enough to convert product_discount to product_discount_id but somehow does not detect the duplicate and so the SQL complained.
Please remove the product_discount column and try again.
This advice also applies to lazyNode who is suffering from the same problem.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: BenDover on September 13, 2007, 19:28:53 pm
Joseph, you are the hero of the day. It uploads now with new products.

Is this a bug?
I used the 26 standard installed fields on the configuration tab from upload.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 13, 2007, 20:29:42 pm
Yes, I would consider this as a bug. Actually, I don't feel it necessary to have both product_discount and product_discount_id in the allowed field. Probably the product_discount should be removed from the allowed field list on the top of the ps_csv.php file.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 14, 2007, 08:51:38 am
Here is an updated version (0.6) of the hack which include
1. several bug fixes including problems with ps_csv and Excel Reader.
2. Added export to Excel file function (the file is actually Excel XML format and is not actual XLS file. But it can be read by Excel recent versions)
3. Added multi-language support which detects your encoding automatically and uses it to set the import encoding.

Let me know if there are problems.

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Kevin on September 14, 2007, 12:13:57 pm
Thanks for making this available.

Do I have to import a parent product first or can I import both parent and child at the same time.

Thanks
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Skate on September 14, 2007, 14:24:28 pm
Here is an updated version (0.6) of the hack which include
1. several bug fixes including problems with ps_csv and Excel Reader.
2. Added export to Excel file function (the file is actually Excel XML format and is not actual XLS file. But it can be read by Excel recent versions)
3. Added multi-language support which detects your encoding automatically and uses it to set the import encoding.

Let me know if there are problems.
Hello I get this:
Error: Function Not Registered. product_xls is not a valid MOS_com_phpShop function.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 14, 2007, 17:50:32 pm
Kevin, I didn't see any code checking the parent product. So probably you need to ensure the parent product is there before adding it to the field. As a rule, I would advise putting the parent product before the child product in your upload.file.

Shalriyar, you have to add the function to the module list. Please see the readme in the zip file.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Kevin on September 14, 2007, 18:02:01 pm
Thanks again Joseph.

One more question,  Does the database discard duplicates?  If I upload the same products will it get duplicated?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 14, 2007, 18:13:02 pm
For csv upload, the system use product_sku to identify the the product. I guess what you mean duplicate products are products with identical product_sku. In that case, the last one in the file will overwrite all previous data.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Kevin on September 14, 2007, 18:23:19 pm
That's what I mean.  Great.

Thank once again.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Kevin on September 16, 2007, 16:21:15 pm
Joseph,

I imported the parent products successfully.  The child products were showing up as parent products so I followed the instructions from this link and the child was imported under the parent product http://forum.virtuemart.net/index.php?topic=26131.msg94560#msg94560 (http://forum.virtuemart.net/index.php?topic=26131.msg94560#msg94560)

The problem I have is that I cannot seem to import the attributes for the child.  If I go to vm admin and click the parent I see the child products but Product Items color and size are blank.  If I click a child and go to item attributes the selection boxes for color and size are not even there.  If I manually add a new item the selection boxes are there for the new child.  Any suggestions?

Thanks,
Kevin
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 17, 2007, 18:54:51 pm
While PHP notices may indicate some minor flaws in the code, they can be safely ignored if no problem is found. By default, they will not show up in PHP. You can disable all notices in the Joomla Global Configuration.
If you have problems in addition to the notices, please post your problems.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 17, 2007, 19:35:29 pm
Export products only means for convenience to show the file structure. If you have additional extraction/filtering needs, why not do it XLS itself. Say sort/filter the data by manufacturer.
Once you have the first data upload successful, you don't need the export feature. You can just edit the xls file you used to upload.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Manuel on September 19, 2007, 05:35:50 am
Hello I get this:
Error: Function Not Registered. product_xls is not a valid MOS_com_phpShop function.

Did someone fixed this promblem???? please reply

thanks

Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 19, 2007, 07:10:40 am
Please follow through the thread or at least read the doucmentation before posting your question. Thanks.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: ShowMeCreative on September 20, 2007, 12:25:19 pm
I am currently running 1.0.12 I am curious if this hack has been incorporated into this version or if I need to add it to import .xls

I appreciate your response
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 20, 2007, 17:13:22 pm
No, the hack is not in the core. You have to install it yourself. But all the files have been updated with 1.0.12 stuff.
Installation guide can be found in the readme file included with the zip.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Kevin on September 21, 2007, 03:12:40 am
Joseph,

What changes are made to the english.php file?

Thanks,
Kevin
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 21, 2007, 03:17:26 am
none
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 21, 2007, 03:35:44 am
Hmm...probably I've added this text:
   var $_PHPSHOP_XLS_SUBMIT_EXPORT = 'Export all products to XLS';
to the end of the file.
Title: SOLVED: Mime type not accepted.
Post by: ShowMeCreative on September 22, 2007, 13:55:19 pm
okay it's working except for images.  I am getting this error that is unlike the other mime errors previously reported:

Error: Mime type not accepted. Type for file uploaded: image/pjpeg

The files I have in the directory are .jpg  is there a line or something i need to add somewhere?

SOLUTION:

After line 1148 in the ps_csv.php file add:

'image/pjpeg',

Duh, I kill me sometimes!
Title: When upload get error: The filename /tmp/php0nsius is not readable
Post by: Sotir Rangelov on September 22, 2007, 18:24:15 pm
Hi!

Thanks for the great hack. I successfully exported my products into an Excel file.
But when I tried to upload an excel file I got the following error:
***
The filename /tmp/php0nsius is not readable
***
Any help is highly appreciated.

Sotir
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 22, 2007, 18:32:19 pm
hyphenated,
Hey, what are you trying to do? This is a product data upload hack, not a file manager. Please use ftp to upload your jpeg files.

Sotir,
Are you using the correct xls version? The hack only support upload to xls 2003. If you continue to have problem, please post a sample xls.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Sotir Rangelov on September 22, 2007, 18:48:34 pm
Hi Joseph,
Thanks for the quick reply.
I've just found where is the problem :)
Yes, the xls version was not correct one.
What I did was to export my products into an Excel file, then added the file in Excel and save it - but it saved it in HTML format with .xls extension. So I had to manual point out that I want to save the file in .xls format. Now it is wokring perfectly.
Thanks again for the great mod!
Have a nice evening,
Sotir
Title: cannot preserve UTF-8 encoding
Post by: Sotir Rangelov on September 22, 2007, 18:54:17 pm
Hi again Joseph,

I just noticed that the products I inserted are not showing correctly. My database is in UTF-8. Can you help me with this please?
Sotir
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 22, 2007, 19:12:21 pm
First check whether your excel file is correct. Then make sure your language and ISO in the Joomla configuration is correct. Also your Joomla backend should also be in utf-8.
If all these settings are in place, the xls upload should handle utf-8 properly. PM me if you have further problem.
 
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 29, 2007, 17:52:23 pm
Brad,

I didn't encounter problems like that before. That could be something unrelated to excel file upload but I don't have time to investigate this right now. Maybe you can try replacing ' and " with &apos; and &quot; and see the effect.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: MCMuckle on October 01, 2007, 23:15:39 pm
Hi,  Thanks for this hack.  At the risk of appearing really dumb can I just clarify something from the readme that I don't get?  The first line says

1. unpack the zip files and upload all files to joomla or mambo
      administration folder.

I have 'administrator' folder, not 'administration'

Is that the one?

Thanks
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 01, 2007, 23:25:58 pm
Sorry for the confusion. Actually, you just need to upload the administrator folder to the Joomla root.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: vkiwi on October 02, 2007, 01:13:41 am
Here is an updated version (0.6) of the hack which include
1. several bug fixes including problems with ps_csv and Excel Reader.
2. Added export to Excel file function (the file is actually Excel XML format and is not actual XLS file. But it can be read by Excel recent versions)
3. Added multi-language support which detects your encoding automatically and uses it to set the import encoding.

Let me know if there are problems.
Hello I get this:
Error: Function Not Registered. product_xls is not a valid MOS_com_phpShop function.


Hi I also get this error message "Error: Function Not Registered. export_xls is not a valid MOS_com_phpShop function."

any ideas on how to fix this?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 02, 2007, 01:26:41 am
Please search through the forum or check the doucmentation with the hack before posting your problem. Thanks.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: vkiwi on October 03, 2007, 01:18:37 am
I have spent 2 hours searching and only found that you need to download the lastest HACK (VERSION 6) which I have done and am still gettnig this error ""Error: Function Not Registered. export_xls is not a valid MOS_com_phpShop function.""
Can this be caused by the server configuration?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 03, 2007, 01:43:56 am
Not sure why you can't find the solution. I've answered similar questions at least twice. This is one of the link
http://forum.virtuemart.net/index.php?topic=27154.msg85497#msg85497
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jano on October 03, 2007, 12:20:31 pm
Hello Joseph,

thank's for your work.

I read whole discussion and I have the same problem with diacritical mark as some users ... the last is Sotir Rangelov. I have all in utf-8 (database, joomla 1.0.13 - also backend, Excel file product upload 0.6, mbstring, iconv, _ISO='utf-8' in language files ...) and when I have diacritical mark (for instance "č" in category path), then I obtain bad import. Excel is correct, because I in your sample.xls file change only RIM to "RIMča čača" and it wouldn't work correct.

Jano

Some time later:

I now look into MySQL and is utf_8_general_ci. There is badly write "RIMča čača". When I handly correct this, then I have correct output. The problem is somewhere in writing data to MySQL.

Excuse me my English ...

-----------------------------

Some time later:   ... in ps_xls.php is probably bug:

Code: [Select]
// if (function_exists('iconv')) {
// $this->xls->setUTFEncoder(''); // bug
// replace with:

if (function_exists('iconv')) {
$this->xls->setUTFEncoder();



[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Peter on October 07, 2007, 02:03:28 am
Joseph, thank you for your fine hack

All the products I have in my site have default shopper and also retail shopper prices. I cannot figure how to include the retail shopper prices in the downloaded xls file

Suggestions anyone?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 07, 2007, 08:54:46 am
I don't think csv download will apply to the product price table. Product price upload works, though. The xls upload/download just makes use the existing csv functions. If you have a product price in excel format, it would not be difficult to format it in the form required for xls upload.
Title: Re: downloading other prices in adition to default price in xls hack
Post by: Peter on October 09, 2007, 05:16:06 am
thanks Joseph. Shame really, as it will be a help to many I would suspect
P
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 15, 2007, 22:03:35 pm
Try turning error reporting to maximum in Joomla/Configuration to see if there are any php error.
For product url, see this board http://forum.virtuemart.net/index.php?board=58.0
Title: Re: Adding Excel File Upload option to product_csv module
Post by: smugl3r on October 24, 2007, 16:39:47 pm
I have a problem when uploading classes into com_virtuemart? Filezilla always gives this error : com_virtuemart/classes/excel/reader.php: No such file or directory
Critical error

How can i solve this problem?

THX in advance
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 24, 2007, 18:15:16 pm
Are you uploading the file to the proper dirctory? The directory should be off your Joomla root directory /administrator. If folder destination is correct, try manually create the folder com_virtuemart/classes/excel off this directory.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mlsuf on October 28, 2007, 22:09:00 pm
Hi

First of all, thank you for giving a hope of being able to upload products en masse.

I have tried testing uploading a small amount of data and have 2 questions.

1.  Is there a limit on the number of Categories, sub categories and sub sub categories you can have.  It appeared to start behaving strangely i.e. setting child Categories as Parents.

2.  The new imported  products are defaulting to Category Browse Page: browse_1 and Show x products per row:1, even though they are set to browse_5 and 2 products per row in the configuration settings.  Are there fields that can be imported that can set these or do you know of a reason why the import is not behaving per the configuration?

Thanks

Martin
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 29, 2007, 06:23:24 am
1. I'm not aware there's any limitation of this. But I noted there is a report that the categories behave strangely when updated to VM 1.0.13a. Are you using that version?
2. The ps_csv class (the CSV module use this class and XLS module in fact reuse this class) doesn't insert a value for the category browse page and show x products per row when creating new category. I agree that it should use the configuration values. You can post the request to the bug track. I would probably include the code when updating to the next version. Meanwhile, you can have 2 workarounds:
a. If you are comfortable with PHP and MySql programming, modify the corresponding code to the ps_csv.php file. (section of code found in around line 1100 of the file.)
b. Change the default values for category browse page and show x products per row in the database. Name of the datatable is jos_vm_category if you are using standard naming.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 29, 2007, 06:38:17 am
If you want to try option A above, replace the section of code in ps_csv.php (lines 1099-1107) with the following:

               // Add category
               $q = "INSERT INTO #__{vm}_category ";
               $q .= "(vendor_id,category_name, category_publish,category_browsepage,products_per_row,cdate,mdate,list_order) ";
               $q .= "VALUES ('1', '";
               $q .= $category_list[$i] . "', '";
               $q .= "Y', '";
               $q .= CATEGORY_TEMPLATE . "', '" . PRODUCTS_PER_ROW . "', '";
               $q .= $timestamp . "', '";
               $q .= $timestamp . "', '$list_order')";
               $db->query($q);

Since, I didn't test the code, make sure you do backup of the category tables as well as ps_csv.php file before trying this. Let us know if the code works. Thanks.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mlsuf on October 31, 2007, 17:55:50 pm
Thanks very much Joseph (especially for your 2nd post).  This worked great.

The issue I had with categories was down (I assume) to apostrophe's in the category title's.  Once taken out these worked fine.  I also uploaded a number of smaller files (1000 to 2000 records at a time) as bigger files tended to cause a few problems.

Thanks again.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on November 13, 2007, 13:38:51 pm
OK, I have next problem.
I uploaded my data on web, fill products desciptions, product  images, categories and picture of categories, etc...
When I want to upload new local_database.xls, all egzisting data will be overwriten (description, images...). How can I manage to upload only quantity and price, without erasing egzisting description and pictures for products. Of course, if the SKU is new, product will be added, and I will put description and pictures manually.
 
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on November 13, 2007, 17:46:05 pm
Only inlcude those fields you want to update. Of course that means you need to separate the upload for update and new products.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on November 14, 2007, 10:37:57 am
If I delete any field/coloumn from my .xls file,  eg. product_desc, i got "Error: CSV file contains unsupported fields: ,  "
If I left that coloumn empty, all product descriptions on site will be delleted, and I got description blank on site.
Do I must change something on Configuration tab?

Solved: First, I 'm idiot! Second, delete these fields on configuration tab, and then delete them on my xls file. It is simple!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on November 14, 2007, 17:05:01 pm
Every day I must export data from my local database and import them to site. On site I arrange details about product.
Does anybody else must empty tables: vm_category and vm_category_href to insert new data. In other case my categories are shown double or triple.
How can I set up categories and images, and don't touch them (they are always same), and just upload products, price, quantity and new products.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on November 14, 2007, 17:54:35 pm
Marko,
You don't need to make any changes to the csv configuration. Just check the use column header as configuration. If you don't include the category path column, no changes will be made to any category item.
And even if you include them, VM is smart enough not to create them unless your names are not exactly the same.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on November 15, 2007, 11:18:33 am
I checked the use column header as configuration. That 's ok.

But ALL columns which I left on my .xls, will repopulate database on site. If that columns is empty, all data on site under will be deleted. (eg. product_desc). If I delete that column in my .xls file, i got error.
When I delete that field from configuration tab and then delete it from .xls it works. But, what to do with categories? Category_path is required filed.
First time when I import new data, I got double categories (eg. Processors (14) and another Processors (14), and so on...) With second upload,  got another category Processors (14)... >:(
If I understand you, just deleting that fields from my .xls file must working. But unfortunately, I got error "Error: CSV file contains unsupported fields: ,  "
Any idea?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on November 15, 2007, 16:46:33 pm
I don't think CSV will work that way. When you delete the column, you need to delete it, not just remove the text or column header. Otherwise, this is still regarded as a column.
If you continue to have problem, try post your xls file.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marko Saraba on November 16, 2007, 12:28:16 pm
Yes, I delete all column, with header and all data under that header. Then must delete on Configuration tab. In other ways I got error.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on November 16, 2007, 17:34:15 pm
please provide a sample xls.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: aivo on November 21, 2007, 01:16:31 am
Joseph plz help me...
Error coding utf-8
 :'(  :'(

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on November 21, 2007, 01:23:20 am
Please explain your problems. I don't even know what language it is (Russian?)
Title: Re: Adding Excel File Upload option to product_csv module
Post by: aivo on November 21, 2007, 11:41:55 am
In Russian. The problem was that the hack does not support the Russian language.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: aivo on November 25, 2007, 01:03:41 am
Here is a solution to the problem!
File ps_xls.php
edit strings
63     if (function_exists('iconv')) {
а
63 if (function_exists('mb')) {

and
68 $this->xls->setOutputEncoding('utf-8');
a
68 $this->xls->setOutputEncoding('cp1251');

enjo
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Maris on November 29, 2007, 09:44:38 am
Hi,
Is there a solution how to get rid of the Javascript errors in IE7?
It is impossible to upload an file, most likely because of these JS errors - after submitting the file upload the browser simply redirects to the top of the page and nothing happens, the upload just doesn't start.  ???

Here are the error messages, I collected from IE7:

Code: [Select]
Line: 1075
Char: 171
Error: Unterminated string constant
Code: 0
URL: administrator/index2.php?pshop_mode=admin&page=product.csv_upload&option=com_virtuemart
----
Line: 433
Char: 2
Error: Object expected
Code: 0
URL: administrator/index2.php?pshop_mode=admin&page=product.csv_upload&option=com_virtuemart

Thanx in advance!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on November 29, 2007, 20:22:31 pm
Probably problems with the data uploaded. Please post the file you are using.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Maris on November 30, 2007, 09:04:44 am
Hi Joseph,

The problem is, that when I enter the CVS upload module (../administrator/index2.php?pshop_mode=admin&page=product.csv_upload&option=com_virtuemart), browse the file to upload and click Submit button - a "#" sign is added at the end of the URL and the page is redirected to the top. The upload process doesn't even start.
That kind of situation basically is observed only on IE7, so are there any suggestions, how to get rid of this problem?

When clicking on the file upload submit button with script error notification enabled on IE7 - the previously posted errors appear.

Maris..
Title: Re: Adding Excel File Upload option to product_csv module
Post by: gwnail on December 10, 2007, 05:29:13 am
Excellent job...this tool works far better than any of the CSV upload tools...Thank you! ;D

Merry Christ*mas to all of y'all....
Title: Re: Adding Excel File Upload option to product_csv module
Post by: NickyV on January 15, 2008, 10:33:02 am
Hi, this hack is fantastic, first time I've ever managed to do the CSV upload!  ;D

One question - the related_products field doesn't seem to be available.  It would be really useful if I could set this up as part of the upload.  Is there a way to add it?

Cheers,
Nicky
Title: Re: Adding Excel File Upload option to product_csv module
Post by: BenDover on January 15, 2008, 14:04:00 pm
Hi Joseph, is it possible to export direct utf-8 from the excel export module?

Import works fine after saving the excel file and changing a few special characters.
Later I used a program to convert from iso->utf-8 and that is working also, but it's an extra step.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on January 16, 2008, 01:55:07 am
Nicky,
related_products is not a supported field in CSV upload and consequently is not supported by XLS upload. You can add this function to ps_csv.php if you are comfortable with php and mysql programming. It doesn't seem to an easy task, though.

Ben,
Right now the export is getting the encoding from your site. If the site encoding is iso, export is in iso. If the site encoding is utf-8 output will be likewise.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: RolandD on January 16, 2008, 08:32:55 am
Hey Nicky,

I want to jump in here. Related products is supported by the CSV Improved component. You can also upload XLS files with this component. Maybe this is of help for you.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: NickyV on January 16, 2008, 10:36:59 am
Hi, thanks for your responses. :-)  Roland, I did test the CSV_improved as well but I got a bit confused with all the options (perhaps if I didn't test it at midnight it might be easier to understand!).  Anyway, I've decided to stick with Joseph's hack for now and also implement the random selection of related_products as detailed here (http://forum.virtuemart.net/index.php?topic=13589.msg25124#msg25124) and see how that works.  If it doesn't then I'll re-test the CSV_improved at a slightly earlier time of day :-)
Cheers,
Nicky
Title: Excel tool success, but for some funny characters displayed.
Post by: jean.roux on January 20, 2008, 23:17:53 pm
Hi, installed the 0.6 version, and used upload. Wow, this is so cool! But have about 4 products that loads very funny characters, example:

D�i�e� �A�r�g�i�t�e�k�t�u�u�r� �v�a�n� � � n� �G�o�d�d�e�l�i�k�

I attach the file I uploaded, in the attached file, the following numbers producs the funny characters: SKU 1085, 1048, 1054, 1100, 1077, 1027. I saved the Excel in version '97. I also cannot find funny characters in the text fields in aboivr SKU's.

Any ideas?

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: RolandD on January 20, 2008, 23:29:20 pm
jean.roux,

See this thread: http://www.csvimproved.com/index.php?option=com_fireboard&Itemid=23&func=view&id=953&catid=1

Check carefully for strange characters.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: MiHu on January 21, 2008, 07:31:05 am
Is this parent child product works?

1st try
1. I copied and pasted one of item (child product) and name it L04 (unique new sku).
2. save and upload
3. it becomes a regular product

2nd try
1. I export to xls and figure out I miss a "product_parent_sku" field, which is not in sample.xls file either.
2. I create a new column called "product_parent_sku" in sample.xls fields and filled corresponding parent_sku and upload
3. the product still a regular product (of course I deleted it before uplaod)

3rd try
1. create a corresponding child item product
2. upload ... this time it works ... but I don't wanna create all child product all via web interface

4th try
1. I delete all of my products and remove image fields from sample.xls
2. all products are regular product and there is no parent child product at all


Could someone please teach me how to create parent child product via this hack?

Thanks,
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on January 21, 2008, 20:46:40 pm
I wish I have time to update the hack with the problem fixes found so far. Anyway, thanks for all your interests.
jean,
your problem seems to be encoding related. The hack assumed utf-8 encoding and so could cause problem. You can try the modifications in Reply #181.

MiHu,
Can you provide a sample xls for testing?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: keesjanisse on January 22, 2008, 00:55:30 am
Thanks for making this available. This is a real time saver !!!  As I'm currently converting a "non-virtuemart product DB" (more than 10.000 products) into VM, this will do the trick !!
One question: can't get the fields product_full_image and product_thumb_image to work, where i copied the specific jpg images to the concerning folders ...components/com_virtuemart/shop_image/product/ and components/com_virtuemart/shop_image/product/resized

Any suggestions on this ?

many thanks !
rgrds Kees



Title: Re: Adding Excel File Upload option to product_csv module
Post by: keesjanisse on January 22, 2008, 01:38:15 am
SOLVED

problem above : didn't apply the field product_price yet
doing that, ...it works !!  ;D


Title: Re: Adding Excel File Upload option to product_csv module
Post by: MiHu on January 22, 2008, 02:54:03 am
MiHu,
Can you provide a sample xls for testing?

I just downloaded the hack file again and remove the image and image thumb field.
I removed all the product and then import from this file.
All products appear as normal product but not child-parent product.

thanks for the response. :D

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: jean.roux on January 22, 2008, 17:50:54 pm
Dear Joseph Khan,

You were right, the fix in reply #181 did solve the problem. The offending characters were ' and ". This solved it.

Thanks a lot!
Title: EN ESPAÑOL - Adding Excel File Upload option to product_csv module
Post by: MUSICOELECTRO on January 25, 2008, 15:32:51 pm
 ;D

Aquì les dejo un aporte.

Todo el archivo de lenguaje del VIRTUEMART incluyendo la traducciòn de este excelente modulo hecho por Joseph.

Solo reemplacen el archivo:
/administrator/components/com_virtuemart/languajes/english.php

Exitos!




Here is the spanish version of all VIRTUEMART component, including the translation of this excelent module maded by Joseph

Only replace the file:
/administrator/components/com_virtuemart/languajes/english.php

Regards!



[attachment cleanup by admin]
Title: Multiple prices upload - Is is possible?
Post by: conken on January 26, 2008, 03:16:17 am
Hi,

just a simple yes or no would be great, I have spent a couple of days trying to complete a 'multiple prices upload' for 5 products with 5 'price quantity' prices. The default and customized xls uploads work a treat but the quantity price uploads, this I am having a problem with. I have followed the documentation for the csv upload with no success and can find nothing on this forum or the web about the xls version.

Is this in fact possible with this hack?

Cheers

Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on January 26, 2008, 05:07:42 am
Mihu,
Your sample file doesn't have the product_parent_sku column which is essential to build product-children relationship

MUSICOELECTRO
Thanks for the Spanish translation. I guess you should rename the file to spanish.php. Will include this in our next update.

conken
Basically anything possible with CSV should work in XLS and anything not probably will not also in this hack. To help us diagnose problem, please provide a sample.


 
 
Title: Re: Adding Excel File Upload option to product_csv module
Post by: conken on January 26, 2008, 05:41:46 am
Hi Joseph,

thank you for your reply and the opportunity to pick your brains... I have tried to upload using the multiple prices function with all columns included...

http://members.westnet.com.au/conyan/multi_sample01.xls

and with only the columns stipulated in the multiple prices upload procedure document...

http://members.westnet.com.au/conyan/multi_sample02.xls

I have been trying to do this on two computers both with Joomla 1.0.13, Virtuemart 1.0.13a and your hack_Virtuemart_xls_upload.0.6.zip, one PC one Mac and I'm starting to feel like a bit of a plonka for not being able to work it out!

Regards

Con
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on January 26, 2008, 06:36:09 am
Con,

I'm sorry to report that the Multiple Price upload has a big flaw. It can only add a new price, not update the price. So, unless you can modify the code in function MultiplePricesUpload in the ps_csv class, price upload must be done in 2 steps:
1. delete the price first
2. upload the new price.

By the way, I noted your xls has a column product_delete which has a value 'Y'. This column is not needed although it does not generate any error. If you want to delete a price, the column header should be price_delete.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: conken on January 26, 2008, 07:14:06 am
Hi Joseph,

thank you for that clarification and pointing out my error on the product_delete, considering it clearly says in the documentation the column needs to be price_delete (you might have guessed I'm not a programmer).

I amended the simpler worksheet (multi_sample02.xls) from product_delete to price_delete and set the prices to 0 and uploaded using the multiple prices function. In the preview it is showing only the first price_quantity_start and price_quantity_end values from the top line and applying them throughout. (see preview.xls). When I continue with the upload I am told:

Line 1: Price cannot be found Product SKU: C0030
Line 2: Price cannot be found Product SKU: C0030
Line 3: Price cannot be found Product SKU: C0030...etc

Updated   0
Deleted   0
Added   0
Skipped   0
Incorrect   10
Total   10

Revised upload xls
http://members.westnet.com.au/conyan/multi_sample04.xls

Show preview result:
http://members.westnet.com.au/conyan/preview.xls


Con



Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on January 26, 2008, 07:25:20 am
The product_price must match the original price. You can't use 0.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Maccadon on January 30, 2008, 23:03:58 pm
I got a problem.
I used this hack before and it worked perfect, but that was only a test.
I now made a complete excell file with all my products.
It uploaded perfect and in the admin section i can see all my products and categories.
But when i get to my site it doesn't show any products.
When i manuelly put a new product in it shows it like it should.

I made sure the option Check Stock is off in configuration.
I also looked at the shoppergroups but nothing seems to help?

I don't know where to look anymore..
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on January 31, 2008, 00:11:54 am
There can be several possible reasons why the products are not shown. In your case, the categories are imported perfectly. But look like the category_id is incorrect. Not sure whether you have modified the code in shop.browse.php or maybe a problem with the SEF you are using. Can't help without looking at the detail.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Maccadon on January 31, 2008, 07:49:30 am
You were right. I turned off an on the SEF404 and everything works.Thank you for everything
Title: Re: Adding Excel File Upload option to product_csv module
Post by: thesweetheaven on February 01, 2008, 08:56:19 am
Hi joseph

already read up the threads few times but cant make the hack working. tried both version 0.52 n 0.6. exactly followed the manual given. tried on and off the sef already still not working. upload sample provided n only edit the category_path to suit my website. got parent n child product.

www.thesweetheaven.com is the website.

fyi, im using Joomla! Stable version is [ 1.0.13 ] , vm 1.0.13a , sh404SEF_Version_1.3 and few others mod n component.

plz help me anyone!

thanx for ur reply.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Henk on February 01, 2008, 22:03:58 pm
Joseph,,
Thank you for all your work. But......I do need some extra help.  ???  I did alle the install etc. as mentioned in your file.zip. What do I do next. Do I use the original csv upload. How do I do a download from my website. Maybe some stupid question but after installing I just don't know what to do.

Thanks a lot

Henk
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on February 01, 2008, 23:13:43 pm
Can you be more specific with your problems?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: SureGrowth on February 02, 2008, 17:54:07 pm
MiHu,
Can you provide a sample xls for testing?

I just downloaded the hack file again and remove the image and image thumb field.

I removed all the product and then import from this file.
All products appear as normal product but not child-parent product.

thanks for the response. :D

Did You solve the problem?

I can't get VM to accept my product_parent_sku - ever time I make a upload - the Product_parent_sku is changed to the products own Sku.... ????
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Henk on February 02, 2008, 19:50:49 pm
Hi Jospeh,

I have found out that after I changed the the language form Dutch in English I suddely found the export to xls button. I have uploaded your sample file. that worked. Till so far I managed to fix the problems. I get further and furter

Thank you for your work

Bye

Henk
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on February 02, 2008, 20:17:20 pm
SureGrowth & MiHu

I spot a problem in the ps_csv class that may be the cause of this.
Try replace line 2450 of ps_csv.php with
            $db_product_parent_id->query("SELECT product_id FROM #__{vm}_product WHERE product_sku = '".$this->product_parent_sku."'");
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on February 04, 2008, 07:48:50 am
please be more specific in your problems.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Azzam on February 05, 2008, 14:47:14 pm
Hi,

i have looked at the hack and must commend you first on the excellent work you provide.  thank you.
Is there a way to add digital products via this hack, can I add a list that will check the tickbox that this is a digital product or would this have to be done manually?
Do you know which file states where these digital files will be located and if this can be amended to host them in a sub-category folder, currently i see them hosted in the root folder.

thanks
Title: Re: Adding Excel File Upload option to product_csv module
Post by: ~ Stephan on February 06, 2008, 03:24:39 am
Hello,

I added your modification for the xls upload on Virtuemart 1.0.14, I am receiving an error "unable to verify your security token" while trying to submit the file.  All other fucntions appear to be fine.

Any ideas??

Thanks,
Stephan
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on February 06, 2008, 07:58:09 am
entrancey,
Your problem seems to be language-related. Please copy and paste the additional language elements from the language file in the hack to your default language file.

Stephan,
Upgrading to VM 1.0.14 will definitely break many customizations. While I have a way that may help alleviate this upgrade problem, I'm not sure whether this will work. If you are comfortable in taking some risk (of course you need to backup your files), you may try replacing the file admin.virtuemart.php (in the administrator/components/com_virtuemart directory) with the attachment.

Azzam,
By digital products, I guess you mean downloadable products. I have no documentation how downloadable products are configured. But you may try to see this works:
In your excel file, add the attribute_values column (if it's not already there). Put download::filename for the product you want to set as downloadable. (filename should be replaced with the file path in your root download directory). Let us know if this works.

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on February 06, 2008, 18:40:22 pm
entrancey,

the language file is for VM language and is stored in administator/components/com_virtuemart/languages. If you installed the hack, it should already be there. What is the default language for your site?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on February 06, 2008, 20:03:06 pm
Not sure what your problem is. The export to xls button should be in VM products->csv/xls upload page. On your right, there should be 2 buttons. The one on the far right is the export function. If you don't see the text, it's because of the language file. But the function should still works.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on February 20, 2008, 06:52:53 am
I understand the hack doesn't work after upgrade to VM 1.0.14 because of the new Security Token and has posted a file to solve that several days ago. I finally got some time to test this and confirm the file works. So if you are troubled by the upgrade, you can download the file, unzip it and put the file in your VM administrator directory (ie administrator/components/com_virtuemart off your Joomla root directory). Of course you need to back up the original file before replacing.

This file is not specific for the excel upload hack alone and may work for other hacks as well especially those make use of the toolbar button. So installing this will help to solve some of your Security Token problems as a bonus. (The excel upload hack is not needed for the file to work.)

The file is attached to this post again for convenience.



[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: pineshop on February 22, 2008, 07:41:15 am
Here is an updated version (0.6) of the hack which include
1. several bug fixes including problems with ps_csv and Excel Reader.
2. Added export to Excel file function (the file is actually Excel XML format and is not actual XLS file. But it can be read by Excel recent versions)
3. Added multi-language support which detects your encoding automatically and uses it to set the import encoding.

Let me know if there are problems.

Thank You Joseph,
After 3 days of struggling with the default CSV upload, I was able to quickly and easily upload to a VM 1.014 site using your latest version (above).  I am extracting my data out of MYOB using MSACESS queries and copy/paste into MSEXCEL 2003. A bit of finessing in excell and then upload using your hack.

I am still fishing around a bit in VM and finding my way around, but did notice a problem with discount_item_id.  The values I enter in my xls file are not corellating well in the upload.  I see it was a problem, is there still some issues I am not aware of? 

I will try and get some specific details to try and point to, but for the most part, this hack is a big breakthrough, thank you once again.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: characterdriven on March 05, 2008, 03:02:31 am
Although the CSV export was working before this hack I'm now getting this error when I try to export CSV or Excel data:
'we could not verify your security token. go back.'
Any suggestions as to a fix?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 05, 2008, 03:09:49 am
Did you try the fix above?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: alexrjhb on March 06, 2008, 00:07:45 am
Hi

Thank you for the post. I fixed my token error, but now have another problem:

I did a quick test, managed to download all products into Excel, added a new test product and when I try to upload the saved Excel file back I get this error:
Error: CSV file contains unsupported fields: product_parent_id,

Please help!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 06, 2008, 00:24:43 am
Yep. product_parent_id is not supported. Use product_parent_sku instead.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: alexrjhb on March 06, 2008, 07:43:03 am
Tx for the reply.

I did not create those fields, I clicked on download column headers, so they come from VirtueMart.

Here is my problem: I download all products to an XLS spreadsheet, open it, view it and so on.
When I try to upload the very same spreadsheet after adding 1 test product, it gives me the error "product_parent_id not supported",
so I go back and download a new spreadsheet without using column headers, add another product, upload the spreadsheet back and
no new product... It does not add products.

Maybe I am doing something wrong?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 06, 2008, 08:06:16 am
Not sure why you get this column. But anyway you can delete the column product_parent_id from the download. Add your new product and try again.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: volt on March 07, 2008, 13:07:42 pm
I,m problem
vm 1.0.14 jooma 1.0.13
export/import product's
MESSENGER
Sorry but we could not verifi your Security Token. Go bac and try again please
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 07, 2008, 22:49:01 pm
try the fix on the previous page and let us know if that works.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mlsuf on March 10, 2008, 20:14:15 pm
Hi Joseph

I am trying to do an export of all products (about 11,000) and I'm getting a

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 45 bytes) in home/brianmee/public_html/includes/database.php on line 489

I've tried this error in google and generally, this appears to be a common error message but all fixes go over my head - some talk of upping memory in php.ini.  Do you have answer for the non technical?

Thanks

Martin
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 10, 2008, 23:14:27 pm
Exporting lots of products will need more memory. Whether you can increase the memory depends on your hosting package. You can contact your web host on that.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mlsuf on March 10, 2008, 23:46:56 pm
Thanks Joseph.

I am looking at using phpMyAdmin to get hold of the data.  The host was very helpful but can't go higher than 32mb.

Title: Re: Adding Excel File Upload option to product_csv module
Post by: mart3223 on March 11, 2008, 21:58:56 pm
Allright i have instal it, but how en where can i upload my XLS file? With the CSV upload?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 11, 2008, 22:06:06 pm
Yes. Menu item will be updated to show CSV/XLS upload.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mart3223 on March 11, 2008, 22:15:45 pm
Allright i see, ive set my language to english then i see it. But if i upload a file i get te page:

The page can not be showed
HTTP403

What goes wrong, thats also with a CSV upload. I use VM 1.0.14
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 12, 2008, 02:07:16 am
Did you add the proper permissions to the function table?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mart3223 on March 12, 2008, 13:54:09 pm
Did you add the proper permissions to the function table?

I have VM migrated to 1.0.13a and it works without a problem :) nice.

Thnx!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: movieman123 on March 18, 2008, 10:07:38 am
i have a question ,
i want to make a mp3 shop in virtuemart
now i want to add the following fields ..
Artist
Song
Album
Year

I cant get it working even with the excel plugin ....
do you have an idea ? or are you able to make an xls file
wich i can import via csv i have installed the hack for xls files

my email address : royhofman@wanadoo.nl
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Kevin on March 30, 2008, 15:52:36 pm
Hi Joseph,

How can I add the field related_products to the excel export? 

Thanks,
Kevin
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 31, 2008, 08:16:24 am
To add support for related_product, you will need to add the function to ps_csv.php. This is not a difficult task but will need some effort.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: abrownleo on April 09, 2008, 09:14:53 am
Hi Joseph

Here is the link for excel doc.

Thanks Again
Andrea

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on April 09, 2008, 18:38:35 pm
There's a blank column in your file. Blank column is not allowed.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: abrownleo on April 09, 2008, 23:57:11 pm
Joseph... You know what you are... A legend!!! Thankyou so much, its all working great now. Thanks Again for your time and help!!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: smkjr on April 15, 2008, 16:45:45 pm
Does this hack work in Joomla 1.5 & the latest 1.1.0 release?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: smkjr on April 15, 2008, 16:59:25 pm
When i am on the admin section of VM i get:

Fatal error: Cannot redeclare class vmLanguage in /home/discsem/public_html/cms/j15/administrator/components/com_virtuemart/languages/english.php on line 1896

ANy ideas?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on April 15, 2008, 17:48:33 pm
No, the hack doesn't work with 1.1.0. VM 1.1.0 has its official csv upload (which linked to csvimproved component). I will consider porting the hack to this new version unless there are popular demand.
For the fatal error, you are probably messing up the language file.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: cliffclof on April 16, 2008, 04:02:33 am
I installed this tried all the hacks and fixes and can't seem to get a sheet to upload.  all it does is try to open some random excel file when i click the upload button.

Any ideas how to get passed the open popup?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on April 16, 2008, 07:22:13 am
Sorry, I don't quite understand your problem. You are suppose to select the excel file you to upload in the popup. And then click the upload button.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: cliffclof on April 17, 2008, 05:46:28 am
I select excel file, click upload.   I get a window asking me to open an excel sheet and nothing uploads.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on April 17, 2008, 06:06:36 am
The procedure should be
1. click browse button. a popup will open where you can select the file.
2. when you click open, a file path will be placed in the textbox.
3. click the submit link to upload the file.

Make sure you have the proper language file elements to the language file if your default language is not English.
If you followed this procedure and yet no file is uploaded, then there is some problem with the xls file you are uploading. You can then post the xls file here.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: cliffclof on April 18, 2008, 03:19:02 am
yes i did that exactly and a few other things to troubleshoot.  I'll have to try the test xls file and see if it has the same problems, but I have a feeling it will do the same unless the code is meant to bring up an open dialog when it reads a bad xls file.

Thanks for the help btw
Title: Re: Adding Excel File Upload option to product_csv module
Post by: gwnail on May 07, 2008, 07:39:52 am
Is the a version of VirtueMart - Excel Upload hack that will work with Joomla_1.0.15_eCommerce_Edition_VM_1.0.15?

Thanks.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: gwnail on May 07, 2008, 07:40:49 am
Is there a version of VirtueMart - Excel Upload hack that will work with Joomla_1.0.15_eCommerce_Edition_VM_1.0.15?

Thanks.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 10, 2008, 01:33:15 am
This hack works with VM 1.0.15. But you need to install also the Security Token fix postedon p.15
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on May 15, 2008, 21:59:25 pm
I got a few requests for porting this hack to VM 1.1. I'm not sure whether there are needs for this since VM11 has dropped the CSV upload feature and opt for the CSVImproved component. If you think there is still a need for this hack, please post a response here.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Desmotech on June 15, 2008, 10:22:27 am
A 1.1 version would be handy to me as my host is still running PHP4.
Thanks,
Dave
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Marcis on June 17, 2008, 14:15:01 pm
I got a few requests for porting this hack to VM 1.1. I'm not sure whether there are needs for this since VM11 has dropped the CSV upload feature and opt for the CSVImproved component. If you think there is still a need for this hack, please post a response here.

Hi Joseph!

Have You made the Excel hack for VM 1.1 or not yet?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Ultrav on June 23, 2008, 06:15:52 am
Yes, please make this for VM 1.1!!! :'( My host wants too much to upgrade my hosting to php5...

Please tell me you are working on it...
Title: Re: Adding Excel File Upload option to product_csv module
Post by: 2006lt on June 26, 2008, 06:07:24 am
dear,please made the Excel hack for VM 1.1.1 + joomla1.0.15 ,
best regards!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 26, 2008, 23:36:50 pm
Thanks for the responses. Pretty busy lately. Will take a look at that when I find time.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Rudolph on June 27, 2008, 01:17:13 am
is there a user manual for csv module?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on June 27, 2008, 01:32:25 am
You will find detailed documentation in your vm administrator site.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: 2006lt on June 27, 2008, 05:55:05 am
Thanks for the responses. Pretty busy lately. Will take a look at that when I find time.
Joseph,thank you!
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mversluis01 on July 23, 2008, 00:41:11 am
Hi,

I hope you can and will be able to help me.
I have a problem with using csv / xls files , every time i try to use the upload function i will get a 403 error page displayed.

It seems like a folder or file doesnot have the right permissions.
But i was searching for a chmod list for Virtualmart 1.015 but didnot found then.

Please help me

Thanks , dear regards
Marco versluis
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mversluis01 on July 25, 2008, 01:06:27 am
i did make some different test about this problem.

1) i have testing with the configuration tab to deleted or ad some field.

This work fine with the standard installation (joonla 1.015 and vm 1.015)
When i install this hack (version 0.6 ) with the security patch ,
i haved tryed it again and i will recieve a 403 error from my internet page.

The Exel download function will work , but the upload function give me the same error page (403 ).

Will you help me ...?

Thanks
Dear regards
Marco versluis
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 25, 2008, 08:11:03 am
403 permission denied may not be a file permission problem. It may be an error generated by VM or Joomla.
What security patch are you referring to? The fix I posted on page 15?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: mversluis01 on July 27, 2008, 10:42:54 am
Hi Joseph,

Yes the security patch I found somewhere in you're post.

Regards,
Title: Re: Adding Excel File Upload option to product_csv module
Post by: KevtheIrish on July 27, 2008, 18:47:25 pm
is there something like this for csvi + 1.1 or in the works even?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: johnjames84 on July 31, 2008, 06:53:56 am
Does this work for VM 1.1.0 with PHP version < 5.

Thanks
James
Title: Re: Adding Excel File Upload option to product_csv module
Post by: crittle1 on August 18, 2008, 05:17:56 am
Although this was for Joomla, I tried in on Mambo.
(I am getting the security token pop up too.)
I'm running vm 1.1.2 and mambo 4.6.5
This does keep the token from coming up, but it does mess around with positioning
of the admin panel, the save/cancle icons disappear and some functions do not work. So, Mambo users may want to try something else.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: kiskavics on September 04, 2008, 11:06:14 am
Thanks,
its great.
Lev
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Vinh on September 30, 2008, 06:14:46 am
I have been trying for a couple of hours now but somehow cannot get it up and running. I have installed the 0.6 version of the hack and the csv upload now shows "csv/excel file upload". I'm also able to select the sample excel file for upload so I assume the installation went fine.

However the results table always shows "Count Total: 0" and nothing seems to have changed in the database. Any clue why that could be?
I've turned on "Collect debug information" but nothing special is outputed (actually nothing). The preview function I think is not implemented?!

I'm on a mac. But that shouldn't be a problem, especially since I haven't even touch the sample.xls with the Mac version of Excel.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 30, 2008, 18:30:14 pm
Preview should work. Looks like something wrong with the excel file. You can post your xls here. What vm version are you using?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Vinh on October 03, 2008, 08:01:35 am
Hi Joseph,

sorry for the late reply. Have been outstation for some days.

I'm using "Joomla! 1.0.12 Stable (Sunfire) eCommerce Edition" with
VirtueMart 1.0.10. The xls file is attached (taken from the v0.6 zip file).

Thanks a lot for your help!

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 04, 2008, 07:15:05 am
Are you having the excel file opened when you upload the file?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Vinh on October 04, 2008, 07:25:40 am
no nothing is open at that time. Do I have a VM version which is maybe not supported?
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 04, 2008, 08:18:21 am
Strange. I have no problem uploading your file.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: volt on October 09, 2008, 11:08:53 am
try the fix on the previous page and let us know if that works.
not work
I,m problem
vm 1.0.14 jooma 1.0.13
export/import product's
MESSENGER
Sorry but we could not verifi your Security Token. Go bac and try again please
Title: Re: Adding Excel File Upload option to product_csv module
Post by: ceemjay on October 23, 2008, 21:04:28 pm
I think I am being really dense and missing something! It might be in the 19 pages of this topic somewhere but I can't find it. First a few questions:

1. Is there a 'native' CSV upload that comes with the VM installation?
2. Does this hack require any CSV upload to be installed first eg CSVI?
3. I have installed CSVI and the hack - how do I upload XLS files?

I have scoured around for ages looking for an "idiot's guide to XLS and CSV import" but seem to have missed it - please could someone point me in the right direction. Posting here seems to be an admission of failure!

Thanks for your help in advance
Clive
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 23, 2008, 21:17:04 pm
The answer depends on what vm version you are using.
VM 1.0.x used to have a CSV upload module included. This module is removed from the core in VM 1.1. Instead they recommend using CSVI.

This hack is for VM 1.0.x and has nothing to do with CSVI.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: ceemjay on October 24, 2008, 20:07:04 pm
Thanks Joseph

I am using the latest VM. Did I miss than in the documentation somewhere?

Cheers
Clive



The answer depends on what vm version you are using.
VM 1.0.x used to have a CSV upload module included. This module is removed from the core in VM 1.1. Instead they recommend using CSVI.
This hack is for VM 1.0.x and has nothing to do with CSVI.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 27, 2008, 07:30:57 am
Sorry for vm 1.1 and later, CSV upload function is not provided. This hack will not work either. There is a link to CSVI website in the default vm menu.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: webdew on January 29, 2009, 05:25:18 am
Hi Mr. Kwan,

I'm new to the import/export business and like to find some help. I've downloaded your code and installed everything fine. Now when I import I can see the tables and everything but I get Incorrect Column count errors?

Also need to seek novice help with the com_csv_improved module I've attached a view images maybe you can help me with the general settings to set this thin up correctly?

Got no errors like the other people did so I think my install was correct, followed all your instructions.

Thank you for all the help.

j

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on January 29, 2009, 06:39:03 am
Look like you are having problem with CSV_Improved. Your question should be directed to their web site.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: webdew on January 29, 2009, 09:25:21 am
Hi Mr. Kwan,

Don't you have a sample file of all fields that virtuemart use and whats supported by this.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: soca on March 18, 2009, 13:54:35 pm
Hi,

I am a newbie tasked with taking over a project that runs on VM 1.0.12. As of now, an up grade to 1.0.15 is out of the question.

I have installed the excel file upload hack and tried uploading afew products without images and that works fine. I am strugling to see how I can upload product images

Is there a step by step on what to do? where the images should be uploaded to?

Also, if there are hundreds of products and I want to delete all the products, is there a simple way to do this?

regards
Soca
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on March 18, 2009, 17:37:53 pm
The simplest way to upload images is to name your image file according to your product sku. Put the file name in the xls file in the column product_full_image and product_thumb_image. Image files should be uploaded by ftp to the directory components/com_virtuemart/images/product/. You should have the dynamic generate thumb in vm config checked.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Rookie18 on July 13, 2009, 17:07:21 pm
Hello Mr.Kwan,

I have downloaded the pack, and installed it like the instruction said.
I work with VM 1.1.0 stable and Joomla dutch version.
Wen i want to integrate the functions i get a error massage:
Fatal error: Cannot redeclare class ps_csv in /administrator/components/com_virtuemart/classes/ps_csv.php on line 2761
Wat can i have done wrong ?
Can you help me ?

Thanks
Ron
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on July 13, 2009, 19:53:14 pm
Hi Ron,
This hack is for vm1.0.x and will not work in vm1.1. Actually the CSV module for vm1.1 have been removed completely.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: alexdaydreaming on September 28, 2009, 12:35:59 pm
Hi Joseph,

I am new to VM and have recently installed VM 1.1.3. And now I have 800+ item to upload to my site. I surely need this hack to help.

Can you pls post an update hack for VM1.1.3?

Thanks a million!
Alex
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 28, 2009, 19:26:51 pm
Alex,
CSV upload is not in the core vm 1.1 and above. You can consider using CSVI instead. If you need further help, please PM me.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: stijn81 on October 14, 2009, 20:03:30 pm
Hi There,

I assume I've followed the installation correctly, but a csv export button does not appear in my virtuemart menu (backend). Only csv export with a link to csv improved.

Have you got any clue what might have gone wrong? I use vm 1.1.2

Thanks
Title: Re: Adding Excel File Upload option to product_csv module
Post by: stijn81 on October 14, 2009, 20:06:03 pm
Or should I use CSVI as well?

Thanks,
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 15, 2009, 07:56:53 am
Please check the posting above.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: stijn81 on October 15, 2009, 16:20:02 pm
Hi Joseph,

Thanks, saw that. However CSVI is not very user-friendly to my opinion. I would like to work with direct Excel files. I''ve tried CSVI, and used a ";" as seperator, which is most friendly with Excel. However, still quite some error-notifications. Have you got any other lead towards a more user-friendly (excel) solution than CSVI?

Thanks,
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on October 15, 2009, 17:51:19 pm
It's a decision of the development team to drop CSV upload support from vm1.1. The duty has been offloaded to CSVI. While I am not in a position to explain how CSVI works (you should direct your questions to them), I believe you can upload XLS file without using any of those separators. Just make your xls file properly formatted and upload it. CSVI will handle the translation. I mean XLS file, not TXT or CSV file. If you need further help, PM me.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: stijn81 on October 16, 2009, 12:14:54 pm
Thanks, I'll try and get CSVI to work... Thanks for the replies.

Title: Re: Adding Excel File Upload option to product_csv module
Post by: lenny1988 on November 29, 2009, 17:18:45 pm
i downloaded the hack and upload to the server and i tryed to add the functions to the product modul but i get an error as so as i select ps_xls

see attach

greets lenny

[attachment cleanup by admin]
Title: Re: Adding Excel File Upload option to product_csv module
Post by: captain carlsberg on December 14, 2009, 15:19:27 pm
I am new to virtue mart and have over the last couple of days been working my way around the system to work out how to use it. I need to upload about 800 items and would like to use the excel system that has been posted on here to upload my products. I have followed the zip instructions but when I get to the class name and class method I am unable to find them in the boxes. Do I need to install something else to allow me to continue. ?

Cpt Carlsberg
Title: Re: Adding Excel File Upload option to product_csv module
Post by: ontljoshi on September 06, 2010, 19:20:38 pm
hi joseph,

i have created both functions as mentioned in the readme file.although it says and shows both function in the function list i can't figure out from where to access/use created options.

could you please through some light?

really appreciate it. many thanks.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 07, 2010, 05:26:57 am
The hack is for vm 1.0.x and things do not work the same in vm 1.1. Please check previous posts in the thread.

Title: Re: Adding Excel File Upload option to product_csv module
Post by: ontljoshi on September 07, 2010, 11:57:47 am
Hi Joseph,

thanks for your reply. I have visited past replies, could not find anything for vm1.1.x and also sounds like there is no work done in that area. I appreciate if you feel its worth working in that area.

any other guide welcomed.

looking forward to hearing from you.

many thanks.
om.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 07, 2010, 14:42:37 pm
As from vm 1.1, vm stops provide data upload function and leave that to CSVI. There are lots more consideration in adding the xls upload function to vm.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: ontljoshi on September 08, 2010, 10:52:46 am
hi joseph,

i am getting following error message
Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in C:\AppServ\www\eisol\administrator\components\com_virtuemart\classes\ps_csv.php on line 314

Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in C:\AppServ\www\eisol\administrator\components\com_virtuemart\classes\ps_csv.php on line 324

dont' understand what to do?

Title: Re: Adding Excel File Upload option to product_csv module
Post by: ontljoshi on September 08, 2010, 21:33:50 pm
Hi joesph,

i am trying your hack and csvi older version but i am not able to upload the csv file. Well, when i use CSVI 0.9 it gives me an error message about product sku not found and column count error message.

kindly guide me.

many thanks.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on September 08, 2010, 22:51:15 pm
The ps_csv error is related to the enclosure character defined on the upload page. If you use xls upload, this error should not occur.

For CSVI support, please contact their website.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Mancru on November 01, 2010, 19:10:12 pm
Hi Joseph!
I do the installation step by step, but the "CSV/Excel File Upload" don't appears to me. How can i solve it? I'm working with Joomla! 1.5.15 in Spanish and VirtueMart 1.1.5 in Spanish too.
Thanks for your time!

Note: I proved it with and without "CSV Improved" installed and nothing.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on November 04, 2010, 00:34:27 am
Please check my comments made before.
Title: Re: Adding Excel File Upload option to product_csv module
Post by: horburyd on April 03, 2011, 15:21:46 pm
i have tried to add the excel import facility as administrator. It says when i need to add the function method - part of the install that i have not enough permision to do this. Please can you advise
Title: Re: Adding Excel File Upload option to product_csv module
Post by: Joseph Kwan on April 04, 2011, 05:53:51 am
This hack does not work for vm 1.1 and above. Please check previous posts.