Ettore Posted November 10, 2010 Posted November 10, 2010 Does anyone know where exactly the catalog and or order information is actually stored, and how to modify them directly? Or if not, this is what I'm looking to do, and any way to do it would be appreciated: I have noticed that when I add a new product to the catalog, it assigns it a number. Like let's say, 307. And to order item 307 from my website, you could go here: http://medexamtools....products_id=307 But let's say I delete item 307 and then I add a new item again. Surprise surprise, it's 308! The original item assigned to the number 307 is deleted all right, but what if I don't WANT my database of items to skip the number 307. How do I assign something to the number 307? The same sort of thing happens with an order. If I test some new module or modification with a fake order, maybe I'll get an order number of 222. And if I delete my order, it's gone, but the next order will be assigned the number 223. How to I set the counter back to 222?
Guest Posted November 10, 2010 Posted November 10, 2010 Ettore, The database auto increments many things, order numbers, product ID's and customer ID's just to name a few. You can not reuse a product ID number. Once it has been deleted, the database will not use the same ID again. Chris
MrPhil Posted November 10, 2010 Posted November 10, 2010 As mentioned, most tables have an "autoincrement" field to assign the "next" ID when something is added. It's generally not a problem to have the ID number ever increasing, and not reuse a deleted ID, as there's space for literally billions of unique IDs. Unless you are in the habit of adding and then deleting literally hundreds of products a day, you should never run out of IDs. That said, it is possible to manually update the database to reuse a deleted ID (provided that no other IDs have been added after that one), by playing with the ALTER AUTOINCREMENT setting in phpMyAdmin to set the "next" value to whatever you want. However, is that really a problem? Unless you suffer from severe OCD, you shouldn't be bothered that ID 307 is not reused and the next ID is 308. No extra database space is consumed (i.e., there is no ghost ID 307 taking up space). You can "fix" that, but why bother? One advantage of the current (no reuse) system is that your site sounds bigger and busier (more popular) than it actually is, if you kept product and order IDs as small as possible. That could be something that tips a hesitant customer into actually ordering something.
Guest Posted November 10, 2010 Posted November 10, 2010 Phil, Since the OP is a newer member I was not going to suggest playing with the database to do that. Sometimes it's better NOT to say things like that........ B)lol Chris
MrPhil Posted November 10, 2010 Posted November 10, 2010 I'm happy to supply rope, and if you want tie up the dog, tie up your lover, or hang yourself with it, it's your business. Note that I did not give all the information needed -- the OP is going to have to do some research in MySQL to find out how exactly to do it, so if they're advanced enough to do the job, any consequences are their own lookout. I did suggest that it is unnecessary to reuse IDs, and a waste of effort, but if the OP is obsessive-compulsive enough to lose sleep over an ID not being reused, they've got bigger problems... So, what you said about the database never reusing an ID is indeed the default behavior, however, it can be modified (not that there's any real point in doing so).
Xpajun Posted November 10, 2010 Posted November 10, 2010 There is at least one occurrence where deleting product 307 and then re-entering the same product as 308 is a big problem - if that product has reviews assigned to it or orders come to that (ask me how I know that :rolleyes: ). Altering a product id manually in the database to match the original can be done, but it is tedious to say the least. It is not ideal and should be done as little as possible but well worth having a practice with a non-live store just to get the hang of it. My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary
Recommended Posts
Archived
This topic is now archived and is closed to further replies.