PDA

View Full Version : Mass updating attributes


pbrodsky
07-26-08, 02:51 AM
Does anyone know of a way to mass update all the attributes in my store?

Here is what I want to accomplish. Currently I have products with individual attribute lists as follows (I don't use the attribute templates):

CODE
S
M
L
XL

What I need to be able to do is update all the attribute codes so that they would look like this:

CODE
S~S
M~M
L~L
XL~XL

In most all cases, the text on either side of the tilde would be the same so basically I want to be able to run a database query to take whatever the CODE is and than add a ~ and the code itself to the end.

I know how to do something like this easily with Excel or Access but I don't know if it's possible with Miva Merchant.

Any suggestions?

Thanks,
Paul

wcw
07-26-08, 02:55 AM
If you can do it in Access, you could export it to a flat file. Then you could import from flat file with the module at
http://www.emporiumplus.com/go/wcw/PROD/1AA/1AA00006
The format the file needs to be in is shown at
http://www.emporiumplus.com/v5/attrimpt.htm

pbrodsky
07-31-08, 10:49 PM
Great suggestion. Thanks! Actually, I used that same program to import my attributes originally about 7 years ago. I had considered it this time but got stuck on the idea of trying to manipulate the database directly.

For anyone else reading this thread, here are the steps I took.

1. Exported my current attributes file
2. Made two copies of the attribute file in Access
3. For copy 1, I changed the file so it would delete all the existing attributes
4. For copy 2, I made the various changes to the codes that I wanted to
5. I used the module remove all the old codes (using copy 1)
6. Used it again to add back the codes with the changes I made (using copy2)

The only reason I had to delete the old codes was because I was actually changing the CODE itself. As such, when I tried it the first time with just the changes, I effectively doubled the number of attribute codes I had. If the CODE is staying the same, this is a great way to mass update attributes in Miva.

Later,
Paul

Brandon MUS
07-31-08, 11:39 PM
Could have done it with a SQL query too (assuming you use a MySQL backend).

Something a long the lines of
UPDATE s01_Options
SET code = CONCAT(code, '~', code)

Just for future reference.