Jump to content
Sign in to follow this  
Guest

excel-import

Recommended Posts

Guest

I JUST installed osCommerce and was checking out some options.

 

I was looking for a way to upload many products at a time and found excel-import_1_51a_1.zip. Installed it and everything looked ok. I went to the admin panel in my store and the link to "Excel Import/Export" was there. I get these errors at the top of the screen:

 

Warning: main(easypopulate_functions.php): failed to open stream: No such file or directory in /home/content/a/l/i/alisammeredith/html/oscommerce/catalog/admin/excel.php on line 5

 

Warning: main(easypopulate_functions.php): failed to open stream: No such file or directory in /home/content/a/l/i/alisammeredith/html/oscommerce/catalog/admin/excel.php on line 5

 

Warning: main(): Failed opening 'easypopulate_functions.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/a/l/i/alisammeredith/html/oscommerce/catalog/admin/excel.php on line 5

 

Then the page looks normal, gives a browse option. Then there is this message:

 

 

Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/content/a/l/i/alisammeredith/html/oscommerce/catalog/admin/excel.php on line 489

 

I've searched contributions and the forums and I don't see anywhere where it says you must have easy_populate first. Thanks in advance for any help.

Share this post


Link to post
Share on other sites

It looks like you do need Easy Populate for that particular contrib.

 

I use Excel, but save the file as CSV and use phpMyAdmin to import the CSV file directly into the database.

 

Takes a little getting used to but here's my method and a couple of things to watch out for:

 

1) Export the table as CSV from within phpMyAdmin, choosing to include the field headings as top row - that way you get the structure you need to fill in

2) Open the exported file in Excel & fill in the values you require:-

  1. Points to watch for during this:

  • dates need to be cell formatted as yyyy-mm-dd.

  • if it says NULL in the table add NULL to corresponding rows, don't just leave it blank.

  • if you're doing an update to add to the table make sure that the first column starts with the next number in the Auto_update sequence or you'll get duplicate index problems.

  • if your text (product descriptions for example) contains commas or quotes they need to be "escaped" - precede each with a \ ( eg don\'t ) for two reasons

i) a comma will make the import think there are more fields than there really are.

ii) an unescaped apostrophe where there shouldn't be one breaks the PHP code, since it's used to enclose elements of that PHP. It will import but you'll have

problems!

 

3) Save the file as xls as a backup - you may have made mistakes regarding syntax etc which will throw errors when you try to import.

 

4) Delete the top row completely, don't just empty it.

 

5) Save the file as CSV (I save as Products_attributes_import.csv for example, so I don't import the file I've just exported!) - comma separated value for those that may not know. Each value (eg product) is on a single row with all the fields separated by commas - Excel will warn you about this format but click ok.

 

6) In phpMyAdmin go to Import and choose the file you saved to import.

  • Select CSV and more options will appear.
  • Tick "Replace Table Data With File" if you wish to overwrite all the contents of the table, if it's an update you're doing then don't.
  • Change "Fields Terminated By" to a comma
  • Hit Go!

You should be presented with a statement at the top of the page saying Success and how many rows were updated.

If you get an error then go back to the CSV file and fix it.

 

Don't know if you'll use this method, but there it is! I have a heavily modified shop so this works for me, you may well find that installing Easy Populate does the job!

 

Regards,

 

Simon

Share this post


Link to post
Share on other sites
Guest
It looks like you do need Easy Populate for that particular contrib.

 

I use Excel, but save the file as CSV and use phpMyAdmin to import the CSV file directly into the database.

 

Takes a little getting used to but here's my method and a couple of things to watch out for:

 

1) Export the table as CSV from within phpMyAdmin, choosing to include the field headings as top row - that way you get the structure you need to fill in

2) Open the exported file in Excel & fill in the values you require:-

  1. Points to watch for during this:

  • dates need to be cell formatted as yyyy-mm-dd.

  • if it says NULL in the table add NULL to corresponding rows, don't just leave it blank.

  • if you're doing an update to add to the table make sure that the first column starts with the next number in the Auto_update sequence or you'll get duplicate index problems.

  • if your text (product descriptions for example) contains commas or quotes they need to be "escaped" - precede each with a \ ( eg don\'t ) for two reasons

i) a comma will make the import think there are more fields than there really are.

ii) an unescaped apostrophe where there shouldn't be one breaks the PHP code, since it's used to enclose elements of that PHP. It will import but you'll have

problems!

 

3) Save the file as xls as a backup - you may have made mistakes regarding syntax etc which will throw errors when you try to import.

 

4) Delete the top row completely, don't just empty it.

 

5) Save the file as CSV (I save as Products_attributes_import.csv for example, so I don't import the file I've just exported!) - comma separated value for those that may not know. Each value (eg product) is on a single row with all the fields separated by commas - Excel will warn you about this format but click ok.

 

6) In phpMyAdmin go to Import and choose the file you saved to import.

  • Select CSV and more options will appear.
  • Tick "Replace Table Data With File" if you wish to overwrite all the contents of the table, if it's an update you're doing then don't.
  • Change "Fields Terminated By" to a comma
  • Hit Go!

You should be presented with a statement at the top of the page saying Success and how many rows were updated.

If you get an error then go back to the CSV file and fix it.

 

Don't know if you'll use this method, but there it is! I have a heavily modified shop so this works for me, you may well find that installing Easy Populate does the job!

 

Regards,

 

Simon

Thanks Simon. I am always amazed at the generosity of people on the forums. I really appreciate your time!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×