Jump to content

Product reference code


nothing.to.see

Recommended Posts

Hi,

 

Is there any way to generate product reference code automatically on adding product page? I need to create reference code with prefix and it should be auto-incremented.

example: 

 

Shoes: SHO-0001, SHO-0002

Gloves: GLO-0001. GLO-0002

 

Or something like that. We can do that manually but it is not healthy way. I think there should be another "better" solution.

Any idea would be helpful.

Thanks in advance.

Link to comment
Share on other sites

Thank you tuk66,

 

I found a little script like that: 

<script>
function gerar(){
if(document.getElementById('reference').value == '') {
hoje = new Date()
dia = hoje.getDate()
mes = hoje.getMonth()
ano = hoje.getFullYear()
hora = hoje.getHours();
minutos = hoje.getMinutes();
segundos =  hoje.getSeconds();
if (dia < 10)
dia = "0" + dia;
mes++;
if (hora < 10)
hora = "0" + hora;
if (minutos < 10)
minutos = "0" + minutos;
if (segundos < 10)
segundos = "0" + segundos;
document.getElementById('reference').value = ano+''+dia+''+mes+''+segundos+''+hora+''+minutos;
}
}
window.onload = gerar();
</script>

But i don't know how to create new module and how to integrate :/

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

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...