News:

Support the VirtueMart project and become a member

Main Menu

CSV Uploads

Started by David Sarvai, January 28, 2004, 23:17:31 PM

Previous topic - Next topic

David Sarvai

For anyone else who was having problems using the CSV (Comman Seperated Value) feature of phpShop, here is a rundown of what happened to me.

I have been beating my head for two days, trying to figure out how to upload a CSV file to the server to load products to the shop.

In doing so, here is what I learned:
1.  IIS uses a MIME/EXCEL attachment type when I tried to upload a .csv file extension.  phpShop basically said that file type was not allowed.  Changing to a .txt allowd me to continue to the next stop.

2.  I upgraded to the newest phpShop for MOS today which included a little more description on how to do the upload.  A second piece I was missing of this puzzle was the mos_pshop_csv table order.  In looking at the table wtih phpAdmin, I could see the numbers relating to the csv field_names.  I added a new row to order the columns the way I wanted, and deleted the old row which was out of sequence.

3.  The makeup of the .csv file.  This took a little doing after I figured out the above two.  For future reference, I would Include a short blurp which states you must reference all 18 fields, whether you choose to use them or not is up to you.

My test UploadProducts.txt file contains the following:

102,Test1,300.00,Category1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
103,Test2,300.00,Category1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
104,Test3,300.00,Category1,0,0,0,0,0,0,0,0,0,0,0,0,0,0

which cooresponds to the following table structure:

Value Field
1 csv_product_sku
2 csv_product_name
3 csv_product_price
4 csv_category_path
5 csv_product_s_desc
6 csv_product_desc
7 csv_product_thumb_image
8 csv_product_full_image
9 csv_product_weight
10 csv_product_weight_uom
11 csv_product_length
12 csv_product_width
13 csv_product_height
14 csv_product_lwh_uom
15 csv_product_in_stock
16 csv_product_available_date
17 csv_product_special
18 csv_product_discount_id

 :ohmy:  Hope this helps someone else.  :ohmy: