Page 1 of 1

Prevent adding a duplicate SKU

Posted: Tue Aug 23, 2016 7:32 pm
by seo chester
When we add a product to the site in the back end, there is no check to see if the SKU we are entering already exists.

Does anyone know how we can have a check at the time of input to prevent the duplicate?

Re: Prevent adding a duplicate SKU

Posted: Tue Aug 23, 2016 9:29 pm
by EvolveWebHosting
It can be added. If you're somewhat familiar with code, you can look at what they've done to check for duplicated URLs and modify it to do the same for the SKU.

I don't have a working example readily available, otherwise I'd publish it.

Re: Prevent adding a duplicate SKU

Posted: Tue Aug 23, 2016 9:46 pm
by fido-x
You'd need to modify a few files - model, controller, template and language. The controller to define the variables for the error message plus the validation, language file to define the actual error message, the template to include the error message if there is a matching SKU and, of course, the model where a new database query would have to be added for the purpose.

The attached vQmod .xml file, which I've just "thrown together" will do it all for you.
Just upload to your server and place in your vqmod/xml folder.