Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EasyPopulate 1.0 - Populate your store from Excel / csv


wasson65

Recommended Posts

do not know if this is of importance,  

 

but when I get this error

 

| 020126.jpg | KRT4889-0 | KRT4889-0 | FAX THERMA | 45.99 | 0 | 10/17/2002 | 1 | products | Thermal Tr | KO-REC-TYP | !New!

| 020126.jpg | KRT3382-0 | KRT3382-0 | RIBBON. CO | 4 | 0 | 10/17/2002 | 1 | products | TYPEWRITER | KO-REC-TYP | !New!

| | | | | | | | | | | |  

 

No products_model field in record or incorrect root for category. I cannot import this record!  

 

| | | | | | | | | | | |  

 

No products_model field in record or incorrect root for category. I cannot import this record!  

 

| | | | | | | | | | | |  

 

No products_model field in record or incorrect root for category. I cannot import this record!  

 

ERROR - I didn't find enough fields!

There should be 11 fields and I found 7 fields.

Are you using the right separation character in your file?

Does the number of fields in easypopulate.php match the number in your file?

 

 

It seems to import all of the products anyways.

-- snip --

Kirk

 

This is not a problem, it just means that Excel had a couple blank rows it exported into the csv file.

 

The error about not enough fields is likely due to a shorter blank line in the excel export. Again, not a problem.

Link to comment
Share on other sites

  • Replies 362
  • Created
  • Last Reply

Top Posters In This Topic

excel will double quote the quotes making it "The book ""A Hobbit's Tale""...

I don't have Excel anymore, but I wanted to prod someone with it to look something. I remember having this problem with Excel placing quotes around a text field automatically. You wouldn't see it until you opened the exported file (friggin' stupid if you ask me... mostly since I don't know why that "feature" would be desireable.) Anyway, there is a setting that will change that to not place the quotes in there.

 

Ugh... I don't know what the setting is and I don't have Excel installed anymore to check, sorry. It might be something to do with the formatting of cells or something. I'm really sorry to not have better info, but I'm working from long-ago memory here. I do remember setting something that may have been file-specific, rather than a permanent Excel setting. It simply stripped the quotes from around the various text fields of the export. Look into settings regarding Text-type fields, I think, at least as a start.

 

Hope this helps... I certainly think it's nice of Tim to work quote-checking into Easy Populate, but I think it's kinder of us to just do away with the problem in the first place from the Excel side. Of course, I also hope I'm remembering things right and I'm not just wasting space here! :D

 

Don't worry, it's already in the new code for 1.4. The code will strip the quotes from the start and end of the field, then replace any remaining doubled sets of quotes with one double quote. This should fix things up right.

Link to comment
Share on other sites

OK, 1.4 is out!

 

Get it here:

 

http://www.oscommerce.com/downloads.php/co...ions,714/type,3

 

This version has the following improvements:

1. tabs instead of semicolons make for less problem with description text breaking on upload.

2. Auto stripping of carriage returns in descriptions on export.

3. Very improved handling of quotes and such in fields.

4. Should fix the double escaped doubled qoute set Excel problem.

5. Ability to SPLIT LARGE FILES into smaller csv files for importing. They still have to be imported one at a time, tho. But it's faster than splittin' 'em by hand.

6. An Explicit End-Of-Row field. NOTE: YOU NEED TO HAVE THIS FIELD IN YOUR DATA WHEN YOU UPLOAD IT. This way the file won't get confused by the odd carriage return in your data.

 

This should fix nearly all the problems people have been having with descriptions needing rewritten, wrong number of fields found, etc.

 

So hammer away, folks. This is really starting to shine, IMNSHO. 8-)

 

Enjoy!

 

Tim

Link to comment
Share on other sites

-- big snip --  

 

Now, having said all that, it may take longer to solve the problem this way than it will take Tim to implement his "large file" optimizations!!

 

Hehe... oh well, I'm getting into the spirit here I guess.  Wish I could contribute more.  :)

 

 

Well, keep the thoughts coming, one thing leads to another!

 

On the list of ideas is the ability to download just a single category or subcategory, so the downloads could be a lot smaller and easier to work with. That may have to wait until next week, as I've got 2 stores I'm supposed to make able to go live in the next day or two, plus an intershipper module to update.

 

Busy busy!

 

Tim

Link to comment
Share on other sites

cool, The splitter option is a definate plus,, I had allready split my file into 53 files of 300 each, and I have imported 9600 products so far, but this is somewhat a test upload, still have not integrated picture files and a few other, I will probably work with 1.4 a little bit tonight and tommorow, and more than likely for a full 8 hours on monday, so I should be able to give 1.4 a hell of a test run on monday importing almost 16,000 products.

 

what a exiting few days this has been.

 

kirk

Link to comment
Share on other sites

uh oh... I've a couple problems...

 

#1 Excel doesn't automatically put quotes around each field... it just does under certain conditions.... so the script never find "--EOR--" because --EOR-- is all that is there... Excel also will not allow for typing in --EOR-- because of the dashes, it interprits them as minus signs, and give you an incomplete formula error. Copying and pasting works, and typing "--EOR--" is allowed too. when you use "--EOR--", excel then double quotes it to """--EOR--"""... I just took care of this for now by replacing "--EOR--" in the easypopulate.php with just --EOR-- and am copying and pasting --EOR-- into the cells since excel prohibits it from being typed in.

 

so now thats working... but then I get this error:

File uploaded.

Temporary filename: C:PHPuploadtempphp3EF.tmp

User filename: books.txt

Size: 30787

The category_root_name is Books

34

| BFAICOL.gi | BFAICOL | Fairies & | A merry wo | 1.5 | 0 | 11/22/2002 | 100 | Books | Angels, De | Marty Nobl | BFAICOL is the number

!New Product!1062 - Duplicate entry '1-1' for key 1

 

INSERT INTO products_description (products_id, language_id, products_name, products_description) VALUES ('1', '1', 'Fairies & Elves Coloring Book by Noble, Marty', 'A merry world awaits you within an enchanted forest, where lovable woodland sprites dwell amid toadstools, flowers, and other natural settings. This fanciful coloring book contains 30 illustrations, depicting fairies and elves perched on blossoms and at play with birds, ladybugs, bees, and other woodland creatures. The broad outlines of these carefully designed images make them easy to color, promising hours of satisfying and magical fun.')

 

[TEP STOP]

 

and nothing is imported...

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

uh oh... I've a couple problems...

 

#1 Excel doesn't automatically put quotes around each field... it just does under certain conditions.... so the script never find "--EOR--" because --EOR-- is all that is there... Excel also will not allow for typing in --EOR-- because of the dashes, it interprits them as minus signs, and give you an incomplete formula error.  Copying and pasting works, and typing "--EOR--" is allowed too.  when you use "--EOR--", excel then double quotes it to """--EOR--"""... I just took care of this for now by replacing "--EOR--" in the easypopulate.php with just --EOR-- and am copying and pasting --EOR-- into the cells since excel prohibits it from being typed in.

 

so now thats working... but then I get this error:

File uploaded.  

Temporary filename: C:PHPuploadtempphp3EF.tmp

User filename: books.txt

Size: 30787

The category_root_name is Books

34

| BFAICOL.gi | BFAICOL | Fairies & | A merry wo | 1.5 | 0 | 11/22/2002 | 100 | Books | Angels, De | Marty Nobl | BFAICOL is the number

!New Product!1062 - Duplicate entry '1-1' for key 1

 

INSERT INTO products_description (products_id, language_id, products_name, products_description) VALUES ('1', '1', 'Fairies & Elves Coloring Book by Noble, Marty', 'A merry world awaits you within an enchanted forest, where lovable woodland sprites dwell amid toadstools, flowers, and other natural settings. This fanciful coloring book contains 30 illustrations, depicting fairies and elves perched on blossoms and at play with birds, ladybugs, bees, and other woodland creatures. The broad outlines of these carefully designed images make them easy to color, promising hours of satisfying and magical fun.')

 

[TEP STOP]

 

and nothing is imported...

 

OK, I put up version 1.5, which should address both of these issues:

1. The --EOR-- has been changed to EOREOR so Excel won't give you fits editing.

2. The EOREOR can be quoted ("EOREOR") or not (EOREOR) and it will still work.

3. Old product descriptions are deleted before creating the new ones, which should fix the sql error you were getting.

 

Let me know how this works for you.

Link to comment
Share on other sites

yes fixed those two, but now an even bigger problem exsits...

 

on upload of file, it shows all went well

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

File uploaded.

Temporary filename: C:PHPuploadtempphp42E.tmp

User filename: EP_Split1.csv

Size: 30739

1

| BFAICOL.gi | BFAICOL | Fairies & | A merry wo | 1.5 | 0 | 11/22/2002 | 100 | Books | Angels, De | Marty Nobl | !New Product!1

| Bfaichi.gi | BFAICHI | Fairy' | Wandering | 19.95 | 0 | 11/22/2002 | 100 | Books | Angels, De | | !New Product!1

| BFAIFUN.gi | BFAIFUN | Fairies Fu | A gift set | 13.5 | 0 | 11/22/2002 | 100 | Books | Angels, De | Marty Nobl | !New Product!1

| BFAIIRO.gi | BFAIIRO | Fairies & | Ethereal f | 3.95 | 0 | 11/22/2002 | 100 | Books | Angels, De | Marty Nobl | !New Product!1

| BFAISTI.gi | BFAISTI | Fairyland | With this | 1.5 | 0 | 11/22/2002 | 100 | Books | Angels, De | Marty Nobl | !New Product!1

| BFAEDES.gi | BFAEDES | Faeries by | Faeries ex | 19.95 | 0 | 11/22/2002 | 100 | Books | Angels, De | | !New Product!1

| BFAITAL.gi | BFAITAL | Fairy Tale | Heres a wo | 1.5 | 0 | 11/23/2002 | 100 | Books | Angels, De | Carolyn Ew | !New Product!1

| BFAITAT.gi | BFAITAT | Fairies & | Get ready | 1.5 | 0 | 11/23/2002 | 100 | Books | Angels, De | Marty Nobl | !New Product!1

| BFINFAI.gi | BFINFAI | Finding Fa | Finding Fa | 17.95 | 0 | 11/23/2002 | 100 | Books | Angels, De | | !New Product!1

| BFAIRIE1.g | BFAIRIE1 | Fairies, T | This is an | 19.95 | 0 | 11/23/2002 | 100 | Books | Angels, De | Suza Scalo | !New Product!1

| BFLOBOO.gi | BFLOBOO | Flower Fai | These ench | 1.5 | 0 | 11/23/2002 | 100 | Books | Angels, De | Marty Nobl | !New Product!1

| BFLOCOL0KI | BFLOCOL0KI | Flower & F | Children w | 3.5 | 0 | 11/23/2002 | 100 | Books | Angels, De | Darcey May | !New Product!1

| BFLOSTI.gi | BFLOSTI | Flower Fai | This engag | 1.5 | 0 | 11/23/2002 | 100 | Books | Angels, De | Darcey May | !New Product!1

| BGOOFAE.gi | BGOOFAE | Good Faeri | In this ri | 30 | 0 | 11/23/2002 | 100 | Books | Angels, De | Brian Frou | !New Product!1

| BGREENC.gi | BGREENC | Great Ency | Sirens and | 25 | 0 | 11/23/2002 | 100 | Books | Angels, De | Pierre Dub | !New Product!1

| BMAGARC.gi | BMAGARC | Magic of t | What the a | 4.25 | 0 | 11/23/2002 | 100 | Books | Angels, De | Chris Jone | !New Product!1

| BMIDNIG.gi | BMIDNIG | Midsummer | It is Mids | 18 | 0 | 11/23/2002 | 100 | Books | Angels, De | Terri Wind | !New Product!1

| BPREFAI.gi | BPREFAI | Pressed Fa | This hands | 15.95 | 0 | 11/23/2002 | 100 | Books | Angels, De | | !New Product!1

| BTOLBES.gi | BTOLBES | A Tolkien | Here is th | 25 | 0 | 11/23/2002 | 100 | Books | Angels, De | David Day | !New Product!1

| BTOLILL.gi | BTOLILL | Tolkien Il | Tolkien Il | 25 | 0 | 11/23/2002 | 100 | Books | Angels, De | David Day | !New Product!1

| BWITGUI1.g | BWITGUI1 | Witches Gu | A Witch& | 14.95 | 0 | 11/23/2002 | 100 | Books | Angels, De | Edain McCo | !New Product!1

| BWITWIZ1.g | BWITWIZ1 | Witches & | The creato | 19.95 | 0 | 11/23/2002 | 100 | Books | Angels, De | Suza Scalo | !New Product!1

| BASTBEG.gi | BASTBEG | Astrology | Learn the | 12.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | William He | !New Product!1

| BASTHAN0AS | BASTHAN0AS | Astrologer | Precise, c | 16 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Louis Acke | !New Product!1

| BASTPRO1.g | BASTPRO1 | Astral Pro | This book | 9.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | | !New Product!1

| BASTPROB.g | BASTPROB | Astral Pro | Gain spiri | 9.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Edain McCo | !New Product!1

| BASTTRA0AP | BASTTRA0AP | Astral Tra | We all hav | 12.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Frost | !New Product!1

| BCELAST.gi | BCELAST | Celtic Ast | Celtic | 13.99 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Phyllis Ve | !New Product!1

| BCRYBAL1.g | BCRYBAL1 | Crystal Ba | Crystal ba | 11 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Uma Silbey | !New Product!1

| BCRYBAL0DI | BCRYBAL0DI | Crystal Ba | A Complete | 3.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Sibyl Ferg | !New Product!1

| BEXPSCR.gi | BEXPSCR | Exploring | Explori | 12.99 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Ambrose Ha | !New Product!1

| BFORTEL1.g | BFORTEL1 | Little Gia | Open a win | 9.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Diagram Gr | !New Product!1

| BHOWOUI1OC | BHOWOUI1OC | How to Use | Michael St | 6.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Michael St | !New Product!1

| BHOWTRA.gi | BHOWTRA | How to Tra | There is n | 10 | 0 | 11/23/2002 | 100 | Books | Astral, Di | | !New Product!1

| BICHING.gi | BICHING | I Ching, T | For centur | 10.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Brian Walk | !New Product!1

| BILLDIV.gi | BILLDIV | Illustrate | Divination | 14.95 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Judy Hall | !New Product!1

| BJOSSIL.gi | BJOSSIL | Jose Silva | Jose Silva | 13.99 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Ed Bernd | !New Product!1

| BKARTAR.gi | BKARTAR | Karmic Tar | A true exp | 19.99 | 0 | 11/23/2002 | 100 | Books | Astral, Di | William La | !New Product!1

| BMAGAST.gi | BMAGAST | Magickal A | We live in | 12.99 | 0 | 11/23/2002 | 100 | Books | Astral, Di | Skye Alexa | !New Product! | | | | | | | | | | | |

 

No products_model field in record or incorrect root for category. I cannot import this record!

 

 

Thats all!

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

 

when I goto Categories/Products in admin, it shows the categories are there and were created, but when I click on a category or subcategory, there are no products listed... it is blank... and if I try to goto my store, the database is gummed up... I can see my header, and only part of the 1st infoBox with "<input type="text" na" inside the box... looking at the HTML, the page has stopped there... it is the same for all pages... unless I delete the categories from admin and then all is well, until I try to import again, and it gives the categories but again none of the products are shown in admin and the storefront doesn't completely load (looks like gummed up database)...

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I can get the files to upload and create catagories... but no items get placed in the catagories.

Any ideas?

 

 

******************************************************

 

File uploaded.

Temporary filename: /tmp/php4HZREi

User filename: Book1.csv

Size: 35472

23

| HTIB_CV_KI | HTIB CV-KI | Composite | MonsterCab | 71.99 | 6 | | 0 | MonsterCab | Cables | Monster Ca | !New Product!23

| HTIB_SV_KI | HTIB SV-KI | Svideo | MonsterCab | 59.99 | 5.5 | | 0 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-1M | | MonsterCab | 4.99 | 0.28 | | 86 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-2M | | MonsterCab | 7.49 | 0.43 | | 139 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-4M | | MonsterCab | 12.49 | 0.86 | | 33 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-6M | | MonsterCab | 14.99 | 1.13 | | 6 | MonsterCab | Cables | Monster Ca | !New Product!23

Link to comment
Share on other sites

I can get the files to upload and create catagories... but no items get placed in the catagories.

Any ideas?

 

 

******************************************************

 

File uploaded.  

Temporary filename: /tmp/php4HZREi

User filename: Book1.csv

Size: 35472

23

| HTIB_CV_KI | HTIB CV-KI | Composite | MonsterCab | 71.99 | 6 | | 0 | MonsterCab | Cables | Monster Ca | !New Product!23

| HTIB_SV_KI | HTIB SV-KI | Svideo | MonsterCab | 59.99 | 5.5 | | 0 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-1M | | MonsterCab | 4.99 | 0.28 | | 86 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-2M | | MonsterCab | 7.49 | 0.43 | | 139 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-4M | | MonsterCab | 12.49 | 0.86 | | 33 | MonsterCab | Cables | Monster Ca | !New Product!23

| I100_glam_ | I100-6M | | MonsterCab | 14.99 | 1.13 | | 6 | MonsterCab | Cables | Monster Ca | !New Product!23

 

For version 1.5 I had re-arranged the queries to clean up the code flow, and in the process lost the line that actually executes the query to insert the new products into the categories.

 

While testing that I found that the manufactuer wasn't getting set for the products, and fixed that.

 

My thanks go to all the people trying this, and sticking with me while I get the kinks out. I think we're getting very close to having something that works really nicely.

 

Let me know how it goes,

Tim

Link to comment
Share on other sites

I have two things so I'll break into 2 posts I guess...

 

1) I haven't gotten past using version 1.2, since it did everything I needed, and by the time I logged back into here, you were rumbling up to 1.5 already! Wow. Thanks a TON for you hard work! That leads me to a suggestion that always seems to ruffle feathers of debate... version numbering.

 

I just thought I'd suggest you implement some variation on your numbering scheme to help distinguish between feature-added versions versus bug-fixing versions. I'd personally like to see something like "major.minor.bugfix" or "major.minorX" where X=letter. Anyway, this might make a quick bug fix at v1.2.4 or v1.2d more distinguishable from v1.4 "Now with large-file support!"... additionally, this gives you much more leeway as you rapidly approach version 2.0!! :D

Link to comment
Share on other sites

The v_date_avail field is not working quite as I would like... I'm not sure if you have a particular reason for it or not, (if so, plz tell) but here's what I see: When you upload a new product with a blank v_date_avail field, the products_date_added field gets filled with the current date/time... cool enough. However, when there's an existing product and you export the .csv from Easy Populate (1.2), it pulls the products_date_added field from the database and sticks it into the v_date_avail field of the .csv.

 

Now, if you upload it again, the v_date_avail is same as the prod_date_add value, so the database would be updated to that value (I'm guessing here.. I haven't tried it, since I don't want to affect all the dates I have in there now.) If you don't see a problem yet, let's use an example of a product: added on the 14th and set to become available on the 18th. Exported on the 15th to change the description and uploaded again. Now the product is set to become available on the 14th. Workaround is to remember to change the v_date_avail field to 18th again before upload... oops, I forgot... also forgot with the other 82 products.

 

Well, that's according to my calculations anyway... maybe I overlooked something, as I'm getting REALLY tired. Having said that, I'm now wondering if this was just a simple oversight and I had no reason to explain all that. Hrmmm. Bed time, obviously.

Link to comment
Share on other sites

The v_date_avail field is not working quite as I would like... I'm not sure if you have a particular reason for it or not, (if so, plz tell)  but here's what I see:  When you upload a new product with a blank v_date_avail field, the products_date_added field gets filled with the current date/time... cool enough.  However, when there's an existing product and you export the .csv from Easy Populate (1.2), it pulls the products_date_added field from the database and sticks it into the v_date_avail field of the .csv.

 

Now, if you upload it again, the v_date_avail is same as the prod_date_add value, so the database would be updated to that value (I'm guessing here.. I haven't tried it, since I don't want to affect all the dates I have in there now.)   If you don't see a problem yet, let's use an example of a product: added on the 14th and set to become available on the 18th.  Exported on the 15th to change the description and uploaded again.  Now the product is set to become available on the 14th.  Workaround is to remember to change the v_date_avail field to 18th again before upload... oops, I forgot... also forgot with the other 82 products.

 

Well, that's according to my calculations anyway... maybe I overlooked something, as I'm getting REALLY tired.   Having said that, I'm now wondering if this was just a simple oversight and I had no reason to explain all that.  Hrmmm.  Bed time, obviously.

 

I think you've got a point here, and I suspect it's acting the way it does by simple oversight and not design, but I'm going to wait until tomorrow to think about it.... brain fried... need sleep... caffine reserves failing...

 

And the number scheme probably makes sense too. When I started this I had no plans to get to 1.6 by any means, much less in 3 days.

 

But it's been amazing to see the ideas drive things forward, and to see how much more robust and competent it's become.

 

I'll let you know what I get figured out...

 

Tim

Link to comment
Share on other sites

minor bug, 1.5/1.6 still say 1.4 in the .php file.

 

I changed mine, but it made me do a double-take.

 

The number will be updated to 1.6 with the new release of 1.7. Uhhh, wait a minute...

 

Gotta stop these 2AM pushes...

Link to comment
Share on other sites

thanks wasson...

 

it is working now, though on line 440, I had to change "$max_manufacturers_id" to the new "$max_mfg_id" string.

 

other than that it works great....

 

but those darn excell double qoutes... the code doesn't allow them to pass through (SQL syntax error), but if you change the $items[$i] = substr($items[$i],1,strlen($items[$i])-1); to something like the length-20 instead of one, it allows it pass through to the database...

 

Now here is the part I don't get (maybe cause I am not that great with PHP)... when you goto look at that product in the database, the double quotes are still around the description (even though we told it to strip off some characters... 20 in my test case!), and the quadruple quotes are still there (even though we told it to change all cases of them to normal double quotes)...

 

example:

 

the description in the Excell cell is: This is my "great" description.

in the exported file it shows as: "This is my ""great"" description."

 

the new code doesn't allow this to pass through to the database, but just for a test I changed the end to -20 instead of -1... It now passes to the database.

 

Pull up the product desctription and I expect to see:

This is my "great" description.

 

But instead see:

"This is my ""great"" description."

 

over at PHP.net in the manual there is a note on str_replace that states it may not work with strings longer than 329 characters. that would explain why the quadrouple quote wasn't changed... but I don't get why the start and end quotes weren't stripped off when they were passed to the database.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I was using version 1.1 everything works fine for me except some of the new products I added went to a invisible category.

 

4mm (200)-->

(39)

8mm

DLT

etc

 

and I checked to see if I had giving a the correct category to them in the CSV and Excel and I did. I put 4mm for all of them. So I was stumped.

I don't know what to do. So I upgraded to 1.6 and now when I try to upload any CSV I get the following error Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/amgtech/public_html/secureadmin/easypopulate.php on line 726

 

What should I do? Thanks.

Link to comment
Share on other sites

did some research on PHP.net and found out some stuff... OSC requires that magic_quotes be enabled in PHP.ini... so with magic quotes enabled, any info passed through PHP is automatically backslashed if needed....

 

here is my fix for the double quotes with magic_quotes enabled... tested it and it works great!

 	 // fix for magic_quotes

	 // check if the last character is a quote; 

	 // if it is, chop off the 1st two and last two characters of the string.

	 if (substr($items[$i],-1) == '"'){

	 $items[$i] = substr($items[$i],2,strlen($items[$i])-4);

	 }

	 // now any remaining doubled double quotes should be converted to one doublequote

	 $items[$i] = str_replace('""',""",$items[$i]); //get rid of those quadrouple quotes

	 $items[$i] = str_replace('"',""",$items[$i]); //replace any double quotes with their char code

	 $items[$i] = str_replace("'",''',$items[$i]); //replace apostrophes with their char code

 

since magic quotes is enabled, when the script gets the fields, the slashes are already there, so I just changed it to look for a quote as the last character and if its there, cut off the 1st two (/") and last two (/") characters of the string... then I just changed the str_replace to account for the slashes that magic_quotes inserted and replace the quadrople & double quotes & apostrophes with their character codes to ensure compadibility with every part of OSC.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Can any of you guys help me to change this version ?

I need to import my product structure as :

 

1. Manufactur

2. Subcategory 1

3. Subcategory 2

4. Subcategory 3

5. Product

 

I have 3700 products to update each week... So I need a "special version" of the excellent importer.

 

Kim

Link to comment
Share on other sites

Hi,

 

suppose I don't need to tell you again how great your contribution is! I'm only setting up my first shop, but I already find it a must have tool!

 

anyway, I was wondering, isn't it possible to also have the possibility to REMOVE records from the database? By for instance changing the "product available" column to "-1" orso? that would also speed up the process of deleting products that are no longer needed, keeping the db small at the same time and fast...

 

it's just a suggestion, but I know it would help me a lot!

 

Thanks a lot for considering this (or just explaining why it's not possible :wink: )

 

DicE

-----

www.mind-it.be

_____.:::.________###__________|/______

:(o o): . (o o) (o o)

ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-

Link to comment
Share on other sites

I was using version 1.1 everything works fine for me except some of the new products I added went to a invisible category.

 

4mm (200)-->

(39)

8mm

DLT

etc

 

and I checked to see if I had giving a the correct category to them in the CSV and Excel and I did. I put 4mm for all of them. So I was stumped.

I don't know what to do. So I upgraded to 1.6 and now when I try to upload any CSV I get the following error Fatal error: Call to undefined function: tep_get_uploaded_file() in /home/amgtech/public_html/secureadmin/easypopulate.php on line 726

 

What should I do? Thanks.

 

OK, it's having trouble finding the function called tep_get_uploaded_file. This function is used to handle the uploaded files like the filemanager tool does. What snapshot are you running? Can you look in

catalog/admin/includes/functions/general.php

and see if you can find a line like

function tep_get_uploaded_file($filename)

 

If it's there, then there is a problem with the files not getting included when they should be. Check your include paths.

 

If it's not there, then you're useing an old snapshot that apparently doesn't support that function. Does your filemanager work for doing uploads/downloads?

 

If filemanager works, then EP should work too.

Link to comment
Share on other sites

Hi,

 

suppose I don't need to tell you again how great your contribution is! I'm only setting up my first shop, but I already find it a must have tool!

 

anyway, I was wondering, isn't it possible to also have the possibility to REMOVE records from the database? By for instance changing the "product available" column to "-1" orso? that would also speed up the process of deleting products that are no longer needed, keeping the db small at the same time and fast...

 

it's just a suggestion, but I know it would help me a lot!

 

Thanks a lot for considering this (or just explaining why it's not possible  :wink:  )

 

DicE

-----

www.mind-it.be

 

This is a great idea! I've been mulling it myself, it seemed odd that there was no way to delete the product.

 

We'd need to decide on the rules for this deletion to occur: If you delete a product in a subcategory/category, does it continue to exist in other categories? If no other categories use it should we "turn it off"?

 

Let's talk this one thru, it makes sense to have some functionality like this.

 

Tim

Link to comment
Share on other sites

did some research on PHP.net and found out some stuff... OSC requires that magic_quotes be enabled in PHP.ini... so with magic quotes enabled, any info passed through PHP is automatically backslashed if needed....

 

here is my fix for the double quotes with magic_quotes enabled... tested it and it works great!

 	 // fix for magic_quotes

	 // check if the last character is a quote; 

	 // if it is, chop off the 1st two and last two characters of the string.

	 if (substr($items[$i],-1) == '"'){

	 $items[$i] = substr($items[$i],2,strlen($items[$i])-4);

	 }

	 // now any remaining doubled double quotes should be converted to one doublequote

	 $items[$i] = str_replace('""',""",$items[$i]); //get rid of those quadrouple quotes

	 $items[$i] = str_replace('"',""",$items[$i]); //replace any double quotes with their char code

	 $items[$i] = str_replace("'",''',$items[$i]); //replace apostrophes with their char code

 

since magic quotes is enabled, when the script gets the fields, the slashes are already there, so I just changed it to look for a quote as the last character and if its there, cut off the 1st two (/") and last two (/") characters of the string... then I just changed the str_replace to account for the slashes that magic_quotes inserted and replace the quadrople & double quotes & apostrophes with their character codes to ensure compadibility with every part of OSC.

 

I love it when user's write the code for me! I'll put this in the next rev for sure.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...