Esempio n. 1
0
 private function getAllProperties($ms = false)
 {
     $ms = PP::resolveMS($ms);
     $all_properties = array();
     $db = Db::getInstance();
     $rows = $db->executeS('SELECT * FROM `' . _DB_PREFIX_ . 'pp_property_lang`');
     $pp_property = $db->executeS('SELECT * FROM `' . _DB_PREFIX_ . 'pp_property`');
     foreach ($this->active_languages as $language) {
         $id_lang = $language['id_lang'];
         $properties = array();
         foreach ($pp_property as $property) {
             $id_pp_property = $property['id_pp_property'];
             $property['text'] = '';
             $property['text_1'] = '';
             $property['text_2'] = '';
             $found = $this->getAllPropertiesLang($property, $rows, $id_pp_property, $id_lang, $ms);
             if (!$found) {
                 $this->getAllPropertiesLang($property, $rows, $id_pp_property, 1, $ms);
             }
             $properties[$id_pp_property] = $property;
         }
         $all_properties[$id_lang] = $properties;
     }
     return $all_properties;
 }
Esempio n. 2
0
 protected function displayAjaxSetMeasurementSystem()
 {
     $this->context->cookie->pp_measurement_system_fo = PP::resolveMS((int) Tools::getValue('measurement_system'));
     die('1');
 }
Esempio n. 3
0
 protected function getCacheId($name = null)
 {
     $cache_array = array();
     $cache_array[] = $name !== null ? $name : $this->name;
     if (Configuration::get('PS_SSL_ENABLED')) {
         $cache_array[] = (int) Tools::usingSecureMode();
     }
     if (Shop::isFeatureActive()) {
         $cache_array[] = (int) $this->context->shop->id;
     }
     if (Group::isFeatureActive()) {
         $cache_array[] = (int) Group::getCurrent()->id;
     }
     if (Language::isMultiLanguageActivated()) {
         $cache_array[] = (int) $this->context->language->id;
     }
     if (Currency::isMultiCurrencyActivated()) {
         $cache_array[] = (int) $this->context->currency->id;
     }
     $cache_array[] = (int) $this->context->country->id;
     if (PP::isMeasurementSystemFOActivated()) {
         $cache_array[] = PP::resolveMS();
     }
     return implode('|', $cache_array);
 }