SylvainG Posted November 28, 2013 Posted November 28, 2013 (edited) Hello, I need to retrieve the main url of a store from its id, any idea? Thx Sylvain Edited November 28, 2013 by SylvainG (see edit history) Share this post Link to post Share on other sites More sharing options...
SylvainG Posted November 28, 2013 Posted November 28, 2013 (edited) My question was'nt really clear, I'm on a multistore configuration, I wanted a map on the default store with all the "real stores" of all the stores. I found a solution, I just modified the sql query in the controller StoresController.php if (Tools::getValue('all') == 1) { $stores = Db::getInstance()->executeS(' SELECT DISTINCT s.*, cl.name country, st.iso_code state, CONCAT(shop_url.domain,\'/\',shop_url.virtual_uri) AS urlShop FROM '._DB_PREFIX_.'store s INNER JOIN ps_store_shop store_shop ON (store_shop.id_store = s.id_store ) INNER JOIN ps_shop_url shop_url ON (shop_url.id_shop = store_shop.id_shop) 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); } Edited November 28, 2013 by SylvainG (see edit history) Share this post Link to post 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