noxz Posted December 17, 2007 Posted December 17, 2007 ok, 2 hours later and here's what I got for ya, (most of this 2 hours is due to the fact the file I thought I was editing, I wasn't editing... so every time I tried it and it didn't work, its becasue the file wasn't changed, LOL (cry).) anywho, I got the "Basic CSV Import" contribution from the contirbutions section, there's no instructions that I can see, so first of all, here's how to plug it in: 1) download it http://addons.oscommerce.com/info/401 This was Oct 02, but the reason I got this one, is because I want to extend and customize it for my own needs, so the basic way of how it works is just what I'm looking for. 2) upload to your server, unzip into catalog/admin section 3) you'll probably find it doesn't work, it will say "records uploaded succesfully" and at the top it will say "No file imported" or something like that. Here's the code addition to jump start it: Around line 18ish, directly underneath case 'import': put this $csv_to_import=$_FILES['csv_to_import']['name']; $csv_to_import_name=$_FILES['csv_to_import']['tmp_name']; change (around line 40) $csv_file_location = DB_IMAGE_DIR . $csv_to_import_name (something like that in capitals anyway, cant remember) to $csv_file_location = $csv_to_import_name Then it should work, do the example "file.csv" and it will say "3 records uploaded successfully" and have no error, however the file.csv lists the items in categories 18, 19 and so forth, from default oscommerce only has 3 categories, so the items are placed in the highest category (software, id is 3), so under software you'll find 3 products with broken images, PR1 PR2 and PR3. Alright, cool. I'm going to bed now (probably), and I'll probably work on extended this to my own needs, it's mainly about a learning curve for me. There's other stuff in the contributions, but some of it was too complex for me to bend to what I wanted, that's why I've gone for this, I may develop it further and put it on as a contrib myself. <ramble> Weee PHP is fun, only just learning it from a book I bought for £20, but its faily similar to bash programming which is my fortay .. thats not how you spell fortay but whatever. Ok. </ramble> That's some geeky tab joke right there. Wooo! Hey, I'm installing this import function into my webshop i had to make as a school assignment. Everything works fine locally but when i try to import online i get these warnings: Warning: copy(file.csv) [function.copy]: failed to open stream: No such file or directory in ***** on line 39 Warning: fopen(/tmp/phpFqVU8U) [function.fopen]: failed to open stream: No such file or directory in ***** on line 47 Warning: fgets(): supplied argument is not a valid stream resource in ***** on line 48 Warning: fgetcsv() expects parameter 1 to be resource, boolean given in ***** on line 50 Warning: fclose(): supplied argument is not a valid stream resource in ***** on line 93 I did everything u did and started with a clean file. Is it possible that my host isn't accepting my connection to the database? Greetz Noxz Thanks in advance! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.