Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution - Excel Import 1.51


dynamok

Recommended Posts

:P

Okay I finally got it to import.

 

Basically the only thing I did different to above post was to make sure the file was not open anywhere before uploading.

 

Ie CLOSE Excel and Wordpad.

 

Thanks guys - you have been really helpful.

Link to comment
Share on other sites

  • Replies 86
  • Created
  • Last Reply

Top Posters In This Topic

I liked this excel import, except I didn't want my clients to have to worry about specifying the key values for root category and subcategory.

 

Plus it wasn't setting the manufacturer ID.

 

Plus some people might not want to have extra columns that they don't care about.

 

So I've got a worked-over version of this that does the following:

 

Allow users to specify the category and subcategory name instead of the id's

Allow users to specify the manufacturer ID or name to get that set as well.

Allow users to change the order of the fields in the csv file

 

A final idea is this: Make and "export" function as well, that would run a query and give a csv file that could be edited and re-uploaded - it would make mass updates easier, and would cut connection time for those who pay for internet by the minute.

 

One other thing I haven't had time to implement is to automatically create new categories and subcategories as needed.

 

I think the tweaks I've done don't reduce the usability for it's original purpose, so if dynamok would like, I'll send him the tweaked code and he can maintain it, or if he'd rather not mess with it, I can put in my warmed over code as another contribution.

 

Tim

Link to comment
Share on other sites

The problem Im having is a 30 second time out limit. I get the fatal error message of this 30 second called from the database.php file on line 45.

 

This is due to the maximum script run length specified in the php.ini file. On most Linux systems this is found in /etc/apache/conf/php.ini

 

Do a search for "30" and change the time to whatever you want.

 

This however probably won't help people with shared hosting solutions unless they have a very cooporative host. In these cases, you'll just need to break the file into smaller parts

Link to comment
Share on other sites

Hi, I did remove the extra "products_status". And checked for the correct root and category also left date available blank. Yet I still get the error

 

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

 

I tried saving it as CSV and Excel and uploading the it and recieve the same error. I also logged in MyPHPAdmin and checked for the "products_model" and its there. I'm still a newcomer to PHP so forgive me if I'm wrong. Have I missed something? Thanks.

Link to comment
Share on other sites

dynamok wrote:

3.    Don't know why you are doing this you can have comas in there.  

7 This is weird, maybe someone knows the answer, but when I save my excel file it automatically saves it with ; and not with , I'm using office XP

 

 

I found that whereever there was a comma the upload program was reading it as another colum thus throwing the data out of alignment

 

Im running office 2000 on windows 98

 

Thanks wasson65 I will check that file tonight

Night and day the only 2 shore things in life

Link to comment
Share on other sites

Allow users to specify the category and subcategory name instead of the id's

Allow users to specify the manufacturer ID or name to get that set as well.

Allow users to change the order of the fields in the csv file

 

A final idea is this:  Make and "export" function as well, that would run a query and give a csv file that could be edited and re-uploaded - it would make mass updates easier, and would cut connection time for those who pay for internet by the minute....

 

Excel Import is nice tool and you can make it better by

enhance its functionality!

 

How about to make a switch that allow users to "Update" and "Append"?

Then if users whom have problems with PHP timeout,

they can still append new records.

 

Go for it! :D

 

Stonez

Link to comment
Share on other sites

For those users having problems getting the test spreadsheet to work:

 

The excel.php expects the file to contain semicolons between the fields. Your Excel may not be doing this. If it isn't finding the semicolons in the right places, it is running your fields together, and that means it won't find all the right fields, and if it can't find a product_model field, it will stop with that error.

 

I personally run OpenOffice on Linux, and when I select "Text CSV" as the SaveAs type, it lets me specify what delimiter to use. I chose a semicolon as a field delimiter and a double quote as a string delimiter. The code worked first time perfectly for me. So the contrib is good to go.

 

The global search/replace all commas with semicolons in Notepad isn't going to work well if you have any descriptions that have commas in them.

 

 

So: How to get excel to use semicolons and not commas? Here is an answer I found doing a google search for

"excel save csv file with semicolon separator"

 

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

http://www.experts-exchange.com/Applicatio...Q_20274893.html

 

Mike,

 

No VBA code is needed, really. CSV files in Excel are not really files with "Comma Separated Values". The separator used is whatever is currently set as the list separator in the Control Panel's regional settings.

 

So, to save as * delimited, do this:

1. Open the Control Panel, double-click "Regional settings", on the numbers tab set list separator to *.

2. Click "Apply"

3. Switch back to Excel and save the sheet as a CSV file.

4. Switch back to control panel and set the list separator back to what it used to be. Probably a comma or a semicolon, depending on where in the world you are.

 

Done!

 

Ture Magnusson

Karlstad, Sweden

 

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

 

Hope this helps some,

Tim

Link to comment
Share on other sites

One more thing I noticed is that people leave "1" in the taxclass even though they don't use taxclass or they have named differently in the admin. Obviously this will give your an error.

Make sure if you are using taxclass in your shop that you rename it to a to "1" or what ever number if you have more than 1.

Link to comment
Share on other sites

wasson65,

If you want to post a new updated version of the module go ahed. We just don't have much time to play with it.

It was done for our store, where we don't use manufactures so we didn't even think about it:)

Link to comment
Share on other sites

Thankyou Wasson65,

 

I found the file much easier to change and navigate - Easy to add my HTML headers and Meta Tags etc.

 

Well done to both you and dynamok for these wonderful contributions.

 

 

:D

Link to comment
Share on other sites

  • 7 months later...

Euhm, nice mod but I have a problem:

 

When I imported the excel file with the info, it is succesfully imported.

That problem has been already solved.

 

BUT:

 

As an user, I clicked on the photo of the product.

Then I get the error: No product found.

 

When I look as an admin, in Catalog -> Catagory / Products -> and then go to the imported product, I can't find it!!

 

Has anybody else this problem too?

Link to comment
Share on other sites

  • 1 year later...

Hi

 

I seem to have found a bug in EasyPopulate

 

Whe a manufacturer name includes a single quote for example Steve's Widgets, Easy Popluate causes a SQL error when uploading the file

 

Has anyone else had this problem or know a fix

 

The exact error message i get is..

 

////////////////////////////////////////////

 

File uploaded.

Temporary filename: /tmp/phpSCoPNu

User filename: Price update Judys.txt

Size: 2045

| 33 | 9.22 | 100 Updated

| 32 | 9.22 | 100 Updated

| 31 | 9.22 | 98 Updated

| 30 | 9.22 | 100 Updated

| 19 | 1.9 | 100 Updated

| 20 | 5.59 | 100 Updated

| 21 | 5.59 | 100 Updated

| 22 | 4.12 | 100 Updated

| 23 | 6.09 | 100 Updated

| 24 | 7.36 | 100 Updated

| 25 | 7.36 | 100 Updated

| 26 | 6.58 | 100 Updated

| 27 | 5.89 | 100 Updated

| 28 | 6.48 | 100 Updated

| 29 | 6.48 | 100 Updated

| 18 | 3.53 | 100 Updated

| 1 | 3.87 | 100 Updated

| 1a | 3.87 | 100 Updated

| 2 | 3.87 | 100 Updated

| 3 | 5.03 | 0 Updated

| 4 | 3.87 | 100 Updated

| 5 | 3.87 | 100 Updated

| 5a | 4.64 | 100 Updated

| 6 | 4.64 | 100 Updated

| 7 | 4.43 | 100 Updated

| 8 | 5.42 | 100 Updated

| 9 | 3.91 | 101 Updated

| 10 | 3.91 | 100 Updated

| 11 | 12.79 | 0 Updated

| 12 | 12.79 | 0 Updated

| 13 | 12.76 | 0 Updated

| 14 | 12.76 | 0 Updated

| 14a | 12.76 | 100 Updated

| 15 | 3.32 | 100 Updated

| 16 | 3.32 | 100 Updated

| 17 | 3.57 | 94 Updated

| 34 | 9.22 | 100 Updated

| 35 | 9.22 | 100 Updated

| 36 | 7.87 | 100 Updated

| 37 | 7.87 | 100 Updated

| 38 | 7.87 | 100 Updated

| 39 | 7.87 | 100 Updated

| 40 | 1.25 | 100 Updated

| 41 | 7.01 | 100 Updated

| 43 | 3.67 | 100 Updated

| 44 | 2.27 | 100 Updated

| 45 | 7.01 | 100 Updated

| 46 | 2.5 | 25 Updated

1064 - You have an error in your SQL syntax near 's'' at line 4

Link to comment
Share on other sites

  • 8 months later...

hi there,,,don't know if this is too late for me to finally spot your work of art, but still wanted to pop a few questions,,,hope someone out there could please help me^^ I'm havinf a little trouble when using this contribution, whenever I upload a file, it ends up like this:

[U]File uploaded.

Temporary filename: /tmp/phprR3Rfj

User filename: Form.CSV

Size: 554

| ..29.E.Fit | | | | | | | | | | | |

 

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

 

Thats all![/u]

just wondering what am I missing? BTW this is my codes are like,I've two sub categories and a main, which one should I put as the "root"?

(in this case 75 or 21?)

Any insight would be appreciated demurely, thank you again^^

| ..75 | Shop by Brands

----| ..21 | A&F Ladies

--------| ..44 | Active Bottoms

--------| ..90 | ArtisTEEic

--------| ..46 | Babe's Denim

--------| ..50 | Buckle up!

Link to comment
Share on other sites

  • 4 weeks later...

When I try to use the Excel Contribution it will add one category to the store with nothing in that category, but I get the error message of:

 

File uploaded.

Temporary filename: /var/tmp/phpQM9ETr

User filename: 8DHDistributing-BAGSCARRYCASESACTIVE.txt

Size: 792962

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

 

insert into categories(date_added, parent_id) values ('2005-09-12',)

 

[TEP STOP]

 

Could someone please help me.

Link to comment
Share on other sites

  • 5 months later...

Maybe I'm bit late, but I still getting this error:

 

File uploaded.

Temporary filename: /var/tmp/php3IHw4L

User filename: Form.csv

Size: 14848

 

Thats all!

|

 

What to do?

Can I send the file to someone that can help me?

 

Thank you.

Paal Martin

Link to comment
Share on other sites

Hello !

 

I have installed the contribution Excel Import 1.51 but when I click on "Excel import!" I obtened an error message :

Access Denied

No Right Permission Access

Please contact your Web Administrator to request

more access or if you found any problem.

 

 

I think it's normal because on catalog.php I have :

//Admin begin
//								   '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
//								   '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
//								   '<a href="' . tep_href_link('excel.php', '', 'NONSSL') . '" class="menuBoxContentLink">Excel import!</a><br>'.
//								   '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
//								   '<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
//								   '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
//								   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');
							   tep_admin_files_boxes(FILENAME_CATEGORIES, BOX_CATALOG_CATEGORIES_PRODUCTS) .
							   tep_admin_files_boxes(FILENAME_PRODUCTS_ATTRIBUTES, BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES) .
							   '<a href="' . tep_href_link('excel.php', '', 'NONSSL') . '" class="menuBoxContentLink">Excel import!</a><br>'.
							   tep_admin_files_boxes(FILENAME_MANUFACTURERS, BOX_CATALOG_MANUFACTURERS) .
							   tep_admin_files_boxes(FILENAME_REVIEWS, BOX_CATALOG_REVIEWS) .
							   tep_admin_files_boxes(FILENAME_SPECIALS, BOX_CATALOG_SPECIALS) .
							   tep_admin_files_boxes(FILENAME_PRODUCTS_EXPECTED, BOX_CATALOG_PRODUCTS_EXPECTED));
//Admin end

 

I think it wants a code style :

tep_admin_files_boxes(FILENAME_MANUFACTURERS, BOX_CATALOG_MANUFACTURERS) .

But how do that good ?

 

Please help me ! I am normaly on the french forum but it is in maintenance...

 

PS : I use MS2.2 051103

Link to comment
Share on other sites

  • 2 weeks later...

hi guys,

 

Very nice and easy contribution to install. it works great but I do have one small problem.

 

I use on my shop dutch and english languaes . but when i import data I only see the english data on my shop and no dutch data. where can I configure on excel.php

 

 

thanks for all your time.

Link to comment
Share on other sites

  • 1 month later...

Hello,

I initially tried the "Easy Populate" contribution but ran into lots of trouble. So, I installed the Excel Import contribution, and had some decent success. I am still unclear on a few things, however. For product descriptions, I usually have a non-bulleted list similar to this:

DESIGNED BY SWAT TEAMS FOR SWAT USE

KEVLAR CONSTRUCTION FOR EXTREME CUT AND HEAT PROTECTION WATER AND CUT RESISTANT LEATHER PALMS REMOVABLE TRIGGER FINER ELASTICIZED WRISTS AND GAUNTLET SUPERIOR GRIP AVAILABLE IN OLIVE DRAB OR BLACK AVAILABLE IN SIZES: SM - XL

 

When I tried pasting this sort of text into excel, it creates new rows. I suppose I need to somehow cause all of the text to go into the one cell. Do you have any suggestions on how best to do this?

 

Another issue I ran into is that I need to give all of my products a "taxable goods" tax class to allow for sales tax when I sell to residents of my state (NY). My header file did not have that column, but the one included with the contribution did. I tried adding the same text to the right side as a new column header, but it seemed to ignore the column. Actually, it re-added the same item instead of trying to just update it.

 

Here is the header file layout I used, which another forum member was nice enough to email me:

manufacturer_name manufacturers_image categories1_name categories2_name categories3_name model_no web_pic list_price weight products_name products_description

 

Lastly, many of my products have attributes such as color and/or size. Is there any way this contribution can accomodate adding attributes?

 

Overall, it will simplify things for me even if I still need to add attributes and manually change the tax class.

 

Thanks,

Ray

Link to comment
Share on other sites

hi guys,

 

Very nice and easy contribution to install. it works great but I do have one small problem.

 

I use on my shop dutch and english languaes . but when i import data I only see the english data on my shop and no dutch data. where can I configure on excel.php

thanks for all your time.

 

Yep I did work on the dutch side only had to change the code to 4! on the next lines: 222, 251,286 and 302 of excel.php

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...