Jump to content

[SOLVED]retrieve a store url in multistore context


Recommended Posts

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 by SylvainG (see edit history)
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...