neergaby95 Posted February 3, 2015 Share Posted February 3, 2015 (edited) Salutare, sunt nou in prestashop si am o intrebare. Cum as putea baga in fisier .tpl data si ora? Uitati sursa: http://pastebin.com/mU7idzeU P.S. Vreau sa fac sa arate diferite mesaje in functie de ora, la utilizator. Spre exemplu : Daca e ora 22: "Buna seara, nume utilizator", "Buna dimineata, utilizator" , etc.. Multumesc **** Imi cer scuze daca am postat in categoria gresita. Edited February 3, 2015 by neergaby95 (see edit history) Link to comment Share on other sites More sharing options...
MihaiAlex Posted February 3, 2015 Share Posted February 3, 2015 <?php$config['date'] = '%I:%M %p';$config['time'] = '%H:%M:%S';$smarty->assign('config', $config);$smarty->assign('yesterday', strtotime('-1 day'));?> Poti folosi "if" pentru afisare mesaje in functie de ora cu "ls" 1 Link to comment Share on other sites More sharing options...
neergaby95 Posted February 3, 2015 Author Share Posted February 3, 2015 Si cum fac? if(is time> 5 || is time < 10){){}? Link to comment Share on other sites More sharing options...
MihaiAlex Posted February 3, 2015 Share Posted February 3, 2015 Sunt de pe telefon si nu prea pot sa raspund. incearca ceva de genu: if '%H';< 22 ls={'buna ziua'} else ls={'buna seara'} Link to comment Share on other sites More sharing options...
neergaby95 Posted February 4, 2015 Author Share Posted February 4, 2015 Tot nu imi iese... Cand pun astea, imi apare scriptul ca si scris:| Link to comment Share on other sites More sharing options...
neergaby95 Posted February 4, 2015 Author Share Posted February 4, 2015 (edited) Ce este gresit in asta? <?php $config['date'] = '%I:%M %p'; $config['time'] = '%H:%M:%S'; $smarty->assign('config', $config); $smarty->assign('yesterday', strtotime('-1 day')); ?> int var=0; if('%H';> 5 || '%H';< 10){ var = l s='Buna dimineata, '; } else if('%H';> 10 || '%H';< 19){ var = l s='Buna ziua, '; }else if('%H';> 19 || '%H';< 05){ var = l s='Buna seara, '; } {var} {$cookie->customer_firstname|escape:'htmlall':'UTF-8'} Edited February 4, 2015 by neergaby95 (see edit history) Link to comment Share on other sites More sharing options...
costi43 Posted February 4, 2015 Share Posted February 4, 2015 in tpl se pune cu "div" nu cu php 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