Prestag0od Posted June 4, 2020 Share Posted June 4, 2020 (edited) 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 June 4, 2020 by Prestan0ob (see edit history) Link to comment Share on other sites More sharing options...
Prestag0od Posted June 7, 2020 Author Share Posted June 7, 2020 i manage to do that by running script with SQL query <?php require_once('./config/config.inc.php'); $sql = 'UPDATE '._DB_PREFIX_.'product SET reference = CONCAT (id_product) where reference = "" OR reference IS NULL'; if (!Db::getInstance()->execute($sql)) die('error!'); I'm still looking for bettter sollution by customize prestashop files. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now