Jump to content

Auto creat product reference number when i add new product.


Recommended Posts

When we create a new product, the reference number must be entered manually.  Is there a way to auto generate a code for this field base on a specific format or product ID?
I found the solution for prestashop 1.7 down in this topic and im looking for the same on prestashop 1.6.



Edited by Prestan0ob (see edit history)
Link to comment
Share on other sites

i manage to do that by running script with SQL query

$sql = 'UPDATE '._DB_PREFIX_.'product SET reference = CONCAT (id_product) where reference = "" OR reference IS NULL';
if (!Db::getInstance()->execute($sql))

I'm still looking for bettter sollution by customize prestashop files.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...