<!--?php class StoresController extends StoresControllerCore { /** * Assign template vars for classical stores */ protected function assignStores() { $magasins = 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); $addresses_formated = array(); foreach ($magasins as &$magasin) { $address = new Address(); $address->country = Country::getNameById($this->context->language->id, $magasin['id_country']); $address->address1 = $magasin['address1']; $address->address2 = $magasin['address2']; $address->postcode = $magasin['postcode']; $address->city = $magasin['city']; $addresses_formated[$magasin['id_store']] = AddressFormat::getFormattedLayoutData($address); $magasin['has_picture'] = file_exists(_PS_STORE_IMG_DIR_.(int)$magasin['id_store'].'.jpg'); if ($working_hours = $this->renderStoreWorkingHours($magasin)) { $magasin['working_hours'] = $working_hours; } } $this->context->smarty->assign('hasStoreIcon', file_exists(_PS_IMG_DIR_.Configuration::get('PS_STORES_ICON'))); $distance_unit = Configuration::get('PS_DISTANCE_UNIT'); if (!in_array($distance_unit, array('km', 'mi'))) { $distance_unit = 'km'; } $this->context->smarty->assign(array( 'distance_unit' => $distance_unit, 'simplifiedStoresDiplay' => false, 'stores' => $this->getStores(), 'magasins' => $magasins, 'addresses_formated' => $addresses_formated, )); } }