Author Topic: Adding Excel File Upload option to product_csv module  (Read 333750 times)

BenDover

  • Beginner
  • *
  • Posts: 15
Re: Adding Excel File Upload option to product_csv module
« Reply #120 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.

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Adding Excel File Upload option to product_csv module
« Reply #121 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 ...
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

hmmurdock

  • Beginner
  • *
  • Posts: 1
Re: Adding Excel File Upload option to product_csv module
« Reply #122 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!

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Adding Excel File Upload option to product_csv module
« Reply #123 on: September 13, 2007, 05:29:10 am »
Please post your excel file.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

BenDover

  • Beginner
  • *
  • Posts: 15
Re: Adding Excel File Upload option to product_csv module
« Reply #124 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'

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Adding Excel File Upload option to product_csv module
« Reply #125 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.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

BenDover

  • Beginner
  • *
  • Posts: 15
Re: Adding Excel File Upload option to product_csv module
« Reply #126 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.

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Adding Excel File Upload option to product_csv module
« Reply #127 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.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Adding Excel File Upload option to product_csv module
« Reply #128 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]
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

Kevin

  • Jr. Member
  • **
  • Posts: 160
Re: Adding Excel File Upload option to product_csv module
« Reply #129 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

Skate

  • Beginner
  • *
  • Posts: 8
Re: Adding Excel File Upload option to product_csv module
« Reply #130 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.

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Adding Excel File Upload option to product_csv module
« Reply #131 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.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

Kevin

  • Jr. Member
  • **
  • Posts: 160
Re: Adding Excel File Upload option to product_csv module
« Reply #132 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?

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Adding Excel File Upload option to product_csv module
« Reply #133 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.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

Kevin

  • Jr. Member
  • **
  • Posts: 160
Re: Adding Excel File Upload option to product_csv module
« Reply #134 on: September 14, 2007, 18:23:19 pm »
That's what I mean.  Great.

Thank once again.