Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with Excel Import/Export when importing twice


Guest

Recommended Posts

Posted

Hello everybody, i'm really NEW to osCommerce, and i'm making the website for an electronics distributor. I'm almost done with the site, but the BIG PROBLEM I have is with the Excel Import/Export contribution, when I import a file with items that are already uploaded to the website, instead of replacing them, it duplicates them >_< (The idea of importing more than once the same item is if I want to change prices on several items at the same time, some times, there is a pricechange for 300 items in the same day.. so it would be very painful to do it one by one :S)

I tried everything, and really don't know what else to do, and i'm going to get my a*s kicked if I can't fix it

 

So PLEASE if anybody knows what to do please reply ASAP...

 

Thanks a LOT !!

Posted

HELP!.. Someone ?? I really need to know if there is a way to upload without duplicating items with this contribution.. !!.. and i'm running out of time :(

Posted

I am having the same problem. This is very bad. I have many items from many sources and I compile all of them in access and export. also need help ASAP

Posted

What you are seeing is what is supposed to happen by default. Reason is the with the data you are importing mySQL has no way of knowing that you have duplicate data.

 

To make this a little clearer I'll give you an example.

 

In your database your data in the products table is set something like this:

 

product_id, product_name, product_price, etc...

 

the product_id is the primary key meaning that there can not be two of that id in the table.

 

When you import the file probably only has something like this:

 

product_name, product_price, etc...

 

Without the product_id being there mySQL can't determine that two records are the same so it adds a duplicate record, but to mySQL it is not a duplicate record. To fix the problem you need to add a column to your excel spreadsheet that has the product_id for each product. You can get these by looking at the products table in the database.

 

Now, I am not familiar with the contribution you are using so I am not sure if this will fix your problem for sure. But I can tell you positively that this is what is happening. So with that said you may give it a try and see if it fixes your problem. The other solution is to just empty the table using phpMyAdmin and then import the data each time you want to update it.

Posted

I' am having the same problem... I am using "Excel Import"

Each time time I make a upload duplicate are created. (Even if le say, I use the same file without changing it twice..) :(

 

Any help would be appreciated!

 

Will

Posted
I' am having the same problem... I am using "Excel Import"

Each time time I make a upload duplicate are created. (Even if le say, I use the same file without changing it twice..) :(

 

Any help would be appreciated!

 

Will

 

See Vasstech's response two posts above yours. It's all about the primary key.

Posted
See Vasstech's response two posts above yours. It's all about the primary key.

 

My question was more...did someone have been able to make a modification to contribution, so items do not duplicate?

 

Regards,

Will

Posted
My question was more...did someone have been able to make a modification to contribution, so items do not duplicate?

 

Regards,

Will

 

Look, I've worked a lot on the issue and have found no solution yet, though EXPORTING de whole SQL database, making the changes and re-IMPORTING allows me to make the changes without duplicating or anything. The bad thing of course is that it is not as practical as using the Excel Import Export contribution, but well, up to now is the only solution I could find. Hope it works for you too :lol:

  • 10 months later...
Posted
Look, I've worked a lot on the issue and have found no solution yet, though EXPORTING de whole SQL database, making the changes and re-IMPORTING allows me to make the changes without duplicating or anything. The bad thing of course is that it is not as practical as using the Excel Import Export contribution, but well, up to now is the only solution I could find. Hope it works for you too :lol:

If you do a SQL export of your products you will find that the first column is the product identifier. This column is not supported in Excel Import which is why ou are creating multiple items. The real solution would be to add this column to the program. However, the less technical solution is to keep you products in folders on your web site, and delete the folder where the change is to be made. Make your changes in your excel spreadsheet then upload the new spread sheet. Since it only takes a few seconds to upload if you have a big pipe, this is fast to do. It is a lot faster to seach and replace a file in a spread sheet than in your online data base especially if you use the global replace feature in excel. If you want to delete an item rather than edit it, do a search for the product using replace but leave the replacement blank. Excel will find the file and delete it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...