Jump to content

Auto creat product reference number when i add new product.


Prestan0ob
 Share

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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More