Unique value in SKU

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 Jahre weitere
Hi,

I have to make my SKU field unique. How can i do this? Can anyone help me?
7 Jahre weitere
You can put this validation logic into "Create" method of \Nop.Admin\Controllers\ProductController.cs. Load a product by specified SKU ("_productService.GetProductBySku" method). If it already exists, then show a warning to a store owner.

P.S. Please do not duplicate forum topics (deleted)
7 Jahre weitere
thanks sir
7 Jahre weitere
Also, see this work item  (and the links it has to other topics)
7 Jahre weitere
I guess I don't understand...the SKU field allows any user input, whether you use the "manage inventory by attribute" or not, so you can easily supply unique SKU values for each product and/or their attribute combinations...

Or, are you looking for a way to automatically GENERATE random/unique SKU values for your inventory?

Or maybe you just want a method to ensure that you have not duplicated any SKU values for the products in your inventory? If so, New York's suggestion leads to a solution..otherwise, just use SSMS to query your products/productattributes tables.
7 Jahre weitere
Sir i just want to add logic in my controller so that whenever any duplicate SKU value will be inserted in the Sku field, it will generate a popup("Duplicate SKU not allowed") and then if any user add duplicate value, it will not be saved.
7 Jahre weitere
Sachin Tripathi Ji wrote:
...

Please do not duplicate forum topics (deleted)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.