Innovacion Usi Posted November 24, 2015 Share Posted November 24, 2015 In the contact-form.tpl I have a list of contact form subjects, but they are always listed alfabetically. How to order them following the ascending id_contact? I am using prestashop 1.6.0.19. <select id="id_contact" class="form-control" name="id_contact"> <option value="0">{l s='-- Choose --'}</option> {foreach from=$contacts item=contact} <option value="{$contact.id_contact|intval}"{if isset($smarty.request.id_contact) && $smarty.request.id_contact == $contact.id_contact} selected="selected" {/if}>{$contact.name|escape:'html':'UTF-8'}</option> {/foreach} </select> Link to comment Share on other sites More sharing options...
chrisranjana.com Posted November 30, 2015 Share Posted November 30, 2015 Try {foreach from=$contacts|@sortby:"#id_contact" item=contact} 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