GT ITECH Posted December 16, 2014 Share Posted December 16, 2014 (edited) Hello, i want to make a normally "simple" thing but i don't know how to do that in prestashop .tpl file ^^ There is the code in my .tpl file : <h4>{l s='Customization settings' mod='customization'}</h4> <div class="separation"></div> <table> <tr> <td class="col-left"> <label>{l s='Customization is active : '}</label> </td> <td> <select id="activep_field" name="activep_field" style="width: 60px;"> <option value="yes" selected="selected">{l s='Yes'}</option> <option value="no">{l s='No'}</option> </select> {$activep} <p class="preference_description">{l s='Choose if customization is active on this product'}.</p> </td> </tr> </table> In this code, the smarty var $activep contain the value of the setting (stored in DB), actual value is "no" but i don't know how to make the select tag activep_field that select by default the option who have the same value than the $activep var. Thank in advance for your help Edited July 31, 2015 by GT ITECH (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted December 17, 2014 Share Posted December 17, 2014 Try <option value="yes" {if $activep == 'yes'}selected="selected"{/if}>{l s='Yes'}</option> <option value="no" {if $activep == 'no'}selected="selected"{/if}>{l s='No'}</option> 1 Link to comment Share on other sites More sharing options...
GT ITECH Posted December 17, 2014 Author Share Posted December 17, 2014 It work fine Thank you very much 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