On the store I built, the model number field is being used to track inventory. Therefore, the value in this field must always be unique.
How can this be accomplished?
Thank you!
On the store I built, the model number field is being used to track inventory. Therefore, the value in this field must always be unique.
How can this be accomplished?
Thank you!
I know this. It is the primary key. However, the products are being tracked by a unique product ID already located on a sticker on the product itself. The model number field is being used to input this number from the sticker on each product.
I just need to know how to make this field unique, that is all.
If you're talking about a seperate model number for each attribute (size, color, etc.), Zencart can't do that with the current version. There is a Stock by Attribute mod.
No. Let me give an example.
I have my store, my store has 5 coin's for sale. It is a coin business.
Coin #1 - Model # - 10001
Coin #2 - Model # - 10002
Coin #3 - Model # - 10003
Coin #4 - Model # - 10004
Coin #5 - Model # - 10005
You see, each coin has a unique model #.
I want to PREVENT something being added into products that has the same model # as one already in the system. So someone could NOT enter a product with a model # of 10001 for example.
Is this more clear now?
Thank you
In Zen Cart the "products_id" is used to uniquely identify each product (think of this as a Zen Cart specific product SKU). This is used internally by Zen Cart to track inventory, manage orders, etc.
It sounds like you want to use a 3rd party software (such as QuickBooks) to manage your inventory... And in your 3rd party software you are identifying products by "model" (and not by the Zen Cart product SKU) ...
If this is the case, you will need to find additional software to integrate (and provide synchronization inventory / data between) the two pieces of software involved. Most well written synchronization software will be able to MAP the Zen Cart product SKU <==> the 3rd Party product SKU.
NOTE: Of course a poor man's solution may be to alter the database table "products" changing the index "idx_products_model_zen" to unique (enforcing unique model numbers at the database level) and the column "products_model" to not allow NULL values (forcing products to have a model)... But this will complicate the upgrade process in the future... And one will still need to synchronize the inventory model, status, quantity, and other data between Zen Cart and the 3rd party inventory management software... Either by hand or using another 3rd Party tool for integration...
Last edited by lhungil; 30 Sep 2014 at 08:13 PM.
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
lhungil's tiny text suggestion should work, but I don't know what error message you would see (if any) when you tried to add a model number that is in use. Be easy enough to check on a test Zencart installation. There's this for after-the-fact:
http://www.zen-cart.com/downloads.php?do=file&id=1323
If I wanted to prevent me duplicating model numbers I would use some javascript to check what you put in the model number in the admin product page to check if it exists or not as you type.
I would use this Instant Search mod as a guide how to do it as it searches the db in real time.
http://www.zen-cart.com/downloads.php?do=file&id=1336
Then you don't have to mess with the database or the code of that admin page.
You just have to educate the user to take heed of the warning.
Steve
github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...
Bookmarks