Jump to content

Manufacturers Slider sortby id_manufacturer


tm09407

Recommended Posts

I need to sort by id logos in Manufacturers Slider. I tried this, creating before a modifier.sortby.php with this code:

 

<?php

#

# Modifier: sortby – allows arrays of named arrays to be sorted by a given field

#

function smarty_modifier_sortby($arrData,$sortfields) {

ksort($arrData);

return $arrData;

}

// You might need this for smarty to load the function, probably not

//$smarty->register_modifier( “sortby”, “smarty_modifier_sortby” );

?>

 

 

 

 

then in tpl modified the code with:

 

{foreach item=manufacturer from=$manufacturers|@sortby:"id_manufacturer"}

 

 

But it keeps sorting by name.

Any idea? I tried many variations but still nothing!!!

Thanks in advance.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...