Community Add-Ons
| Maintainers: | guardianms |
Get Next Available Model Number
for osCommerce Online Merchant v2.2
We run our Model Numbers as the Vendors Model Number and then we have added a field for our in-store SKU number. This SKU number is a simple sequential 5 digit number. We ran into the problem that with having too many people working in the database at the same time, there was not an easy way to keep track of the next number. This left holes and duplications. I tried the automatic numbering contribution where it gave the numbers based on their auto_increment value in the database, but that made tagging the items harder. This was my solution; simply put a number next to the SKU field that would tell us the next available number.
This code will put a message on the right side of your text box (Model Number, or any other field you want) that says “Next Available Number: xxxxx”
This will actually find the next missing number in the field. Not just give you the highest number. This is also good for reusing numbers as products are deleted.
Requirements: Your products_model (or in our case products_code) field must be of type int. And a good backup.
We run our Model Numbers as the Vendors Model Number and then we have added a field for our in-store SKU number. This SKU number is a simple sequential 5 digit number. We ran into the problem that with having too many people working in the database at the same time, there was not an easy way to keep track of the next number. This left holes and duplications. I tried the automatic numbering contribution where it gave the numbers based on their auto_increment value in the database, but that made tagging the items harder. This was my solution; simply put a number next to the SKU field that would tell us the next available number.
This code will put a message on the right side of your text box (Model Number, or any other field you want) that says “Next Available Number: xxxxx”
This will actually find the next missing number in the field. Not just give you the highest number. This is also good for reusing numbers as products are deleted.
Requirements: Your products_model (or in our case products_code) field must be of type int. And a good backup.
Feel free to check us out, www.GuardianAngelStore.com
