Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Sorting Array in Smarty Alphabetically

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-13-2011, 05:09 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Sorting Array in Smarty Alphabetically

Hi All,

I was wondering, is there some way of using a foreach loop in smarty and sorting alphabetically. I am retrieving a list of Newlists from the DB on the register screen, so in register.tpl I am stepping through. Similar to:

Code:
{foreach from $newslists item=z} {assign var="id" value=$z.listid} {if $z.listid lt 5} HTML HERE including {$z.name} {/if} {/foreach}

I would like to build the list of checkboxes ordered by name. Does anyone know how to do this?

Thanks,
FWM.
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote
  #2  
Old 10-13-2011, 05:40 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Sorting Array in Smarty Alphabetically

Thsi may help
http://www.smarty.net/forums/viewtopic.php?t=1079
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 10-19-2011, 04:58 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Re: Sorting Array in Smarty Alphabetically

Thanks Steve,

That worked.
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:16 AM.

   

 
X-Cart forums © 2001-2020