Quote Originally Posted by waterbender View Post
Hi sorry, I don't fully understand. Are you saying that you don't recommend using products_id as the primary index to import/update products unless we do some code changes to suit? I use products_model for other purpose and most products don't have unique model numbers.
With regards to this plugin, I would agree with that statement, that would not make changes to use product_id as the primary key without making changes to suit, or without acknowledging the effect(s) of doing so without making code changes to suit. Without a little investigation, I am not sure what the effect would be if say the following were true: the autonumber for the table is: 5, six products have been added to the table with id numbers of 1-6, and then the standard categories add products option is used. I don't know whether ZC would try to add an item at position 5 (error), add an item at position 7 (okay) or update the item at position 5 (essentially an error for the purposes identified here). Alternatively an additional field could be added to the table (I think numinix has something like this), but long and short of it is, it would be wrong of me not to point out some things to take into consideration. There are those out there that actually se the model number for something of value and as written this plug-in doesn't do what they want, but there are also those out there that just dutifully poplate the model_number with something unique so they can use this plugin. Whatever the case, the datafile needs something unique to be able to do it's job, and it would be my recommendation that whatever is used is available in both the datafile and onscreen when adding/modifying a product within the admin panel unless that option becomes totally disabled to support only this plugin (also not recommended).

As to the example above, if you do create code to address the autonumber, would want to also consider a situation where the last record added was 6, and now 1145 is added, what about 7 through 1144? Left blank or non-existent and the autonumber? Updated to 1146? What happens when someone picks the last possible number as their next product or a number that is outside the scope of the table? These things need to be considered if changing to the product_id instead of using a method similar to this plugin of having a unique identifier that is independent of the database size (though there may be a limit as to the length of the identifier). Again, whatever is chosen may be good for your usage, but possibly not for the masses. The other thing about this module is that it really is database/store independent. I could essentially dowload all of the products in my store, send you the file, and you could upload all of my products into your store. Sure might append something to the model number to try to ensure even further that it was unique like an acronym for my store, but more than likely it could all be copied over independent of your numbering. Further, and possibly more helpful, if your database got a little funky, could download all of the products and associated data, then clear the applicable tables and upload all of the data again without recourse of id numbers. (WARNING, this is a general discussion here, care must be taken to accomplish what was just described, or else your store could become useless. There may be other dependencies applicable to your store that may not have been discussed. Again warning, I am not responsible for actions you take based on the above discussion.)