Jump to content

Sort the order of the stores list


Ray UK

Recommended Posts

Hi,

 

Im making a page ( http://www.no-match.co.uk/storeslist ) with just a list of our stores on with a link to each stores individual pages by clicking on the store name.  I cant work out how to sort the list into alphabetical order on the name.

 

I have tried

ORDER BY name ASC in here

protected function assignStoresSimplified()
    {
        $stores = Db::getInstance()->executeS('
		SELECT s.*, cl.name country, st.iso_code state
		FROM '._DB_PREFIX_.'store s
		'.Shop::addSqlAssociation('store', 's').'
		LEFT JOIN '._DB_PREFIX_.'country_lang cl ON (cl.id_country = s.id_country)
		LEFT JOIN '._DB_PREFIX_.'state st ON (st.id_state = s.id_state)
		WHERE s.active = 1 AND cl.id_lang = '.(int)$this->context->language->id)
		;

but it doesnt work.

 

Any ideas

 

Cheers

Link to comment
Share on other sites

  • 1 year later...

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...