Paulo Nacif Posted June 12, 2013 Share Posted June 12, 2013 Hello, i am new in presta shop developer. How put my code in new product, being created in a module? <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> Link to comment Share on other sites More sharing options...
vekia Posted June 12, 2013 Share Posted June 12, 2013 sorry but explain it a bit more... where you want to put this code? 1 Link to comment Share on other sites More sharing options...
Paulo Nacif Posted June 12, 2013 Author Share Posted June 12, 2013 I created a module, the definition of this module is to generate numbers to put in the reference field (page 'new product') I learned to make modules, just for show and not perform within the administration Link to comment Share on other sites More sharing options...
vekia Posted June 12, 2013 Share Posted June 12, 2013 you can create module with hook: displayBackOfficeFooter just use .tpl file with your code (don't forget about {literal}{/literal} tags) i think that this is all in this case 1 Link to comment Share on other sites More sharing options...
Paulo Nacif Posted June 12, 2013 Author Share Posted June 12, 2013 thank you very much!! you can create module with hook: displayBackOfficeFooter just use .tpl file with your code (don't forget about {literal}{/literal} tags) i think that this is all in this case Link to comment Share on other sites More sharing options...
vekia Posted June 12, 2013 Share Posted June 12, 2013 let us know after tests 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