public function initializeContext() { global $smarty; // Clean all cache values Cache::clean('*'); Context::getContext()->shop = new Shop(1); Shop::setContext(Shop::CONTEXT_SHOP, 1); Configuration::loadConfiguration(); if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language)) { if ($id_lang = (int) Configuration::get('PS_LANG_DEFAULT')) { Context::getContext()->language = new Language($id_lang); } } if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country)) { if ($id_country = (int) Configuration::get('PS_COUNTRY_DEFAULT')) { Context::getContext()->country = new Country((int) $id_country); } } if (!isset(Context::getContext()->currency) || !Validate::isLoadedObject(Context::getContext()->currency)) { if ($id_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT')) { Context::getContext()->currency = new Currency((int) $id_currency); } } Context::getContext()->cart = new Cart(); Context::getContext()->employee = new Employee(1); if (!defined('_PS_SMARTY_FAST_LOAD_')) { define('_PS_SMARTY_FAST_LOAD_', true); } require_once _PS_ROOT_DIR_ . '/config/smarty.config.inc.php'; Context::getContext()->smarty = $smarty; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->registerHook('actionValidateOrder') && Configuration::updateValue('NEW_ORDER_WEBHOOK_URL', 'http://www.example.com/new-order-webhook'); }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->registerHook('actionObjectCustomerUpdateAfter') && $this->registerHook('actionObjectCustomerUpdateBefore'); }
public function install() { $e = get_headers(ERP_WS); if ($e[0] == 'HTTP/1.1 200 OK') { if ($this->isCurlInstalled() == false) { $this->_errors[] = $this->l('Error while installing the module. CURL Extension is not active on your server. Please contact your server administrator.'); return false; } if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!Configuration::hasKey('ERP_ADMIN_PARENT_ORDERS_TAB_ID')) { Configuration::updateValue('ERP_ADMIN_PARENT_ORDERS_TAB_ID', Tab::getIdFromClassName('AdminParentOrders')); } if (parent::install() != false && $this->parseSQL('install.sql') != false && $this->installStockMvtReason() != false && $this->installErpTab() != false && $this->addTrashCategory() != false && $this->addOrderState($this->l('Order to the supplier')) != false && $this->registerHook('actionOrderStatusUpdate') != false && $this->registerHook('displayBackOfficeHeader') != false) { foreach ($this->field_name_configuration as $field_name => $param) { Configuration::updateValue(Tools::strtoupper($field_name), $param['default']); } // load a licence if exits $this->loadLicenceIfExists(); // save the first install date if (!Configuration::hasKey('ERP_FIRST_INSTALL_DATE') || Configuration::get('ERP_FIRST_INSTALL_DATE') == '' || Configuration::get('ERP_FIRST_INSTALL_DATE') == false) { Configuration::updateValue('ERP_FIRST_INSTALL_DATE', date("Y-m-d H:i:s")); } return true; } return false; } else { $this->_errors[] = $this->l('Error while getting headers of WS ! Please contact the customer service.'); return false; } }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } //Ajout d'un onglet à la racine du site $parentTab = Tab::getIdFromClassName('AdminImporter'); if (empty($parentTab)) { $parentTab = self::createTab(0, $this->name, 'EDC feeds importer', 'AdminImporter'); } self::createTab($parentTab, $this->name, 'Import des produits', 'AdminImporterRunning'); self::createTab($parentTab, $this->name, 'Configuration', 'AdminImporterConfiguration'); self::createTab($parentTab, $this->name, 'Counter', 'AdminImporterCounter'); self::createTab($parentTab, $this->name, 'Labo', 'AdminImporterLab'); // self::createTab($parentTab, $this->name, 'CRON', 'AdminImporterCron'); Configuration::updateValue('IMPORTER_URL_FULL_FEED', 'http://graphics.edc-internet.nl/b2b_feed.php?key=[KEY]&sort=xml&type=xml&lang=[LANG]&version=2015'); Configuration::updateValue('IMPORTER_URL_NEW_PRODUCTS', 'http://graphics.edc-internet.nl/b2b_feed.php?key=[KEY]&sort=xml&type=xml&lang=[LANG]&version=2015&new=1'); Configuration::updateValue('IMPORTER_URL_STOCK', 'http://graphics.edc-internet.nl/xml/eg_xml_feed_stock.xml'); Configuration::updateValue('IMPORTER_DISCONTINUED', 'http://graphics.edc-internet.nl/xml/deleted_products.xml'); Configuration::updateValue('IMPORTER_IMPORT_CURRENT_STEP', 0); Configuration::updateValue('IMPORTER_IMPORT_CURRENT_KEY_IN_XML', 0); Configuration::updateValue('IMPORTER_XML_FILE', ''); Configuration::updateValue('IMPORTER_XML_COUNT'); //Créer le dossier import if (!parent::install() || !$this->installDb()) { return false; } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->registerHook('actionPaymentConfirmation') && $this->registerHook('actionValidateOrder') && Configuration::updateValue('ANDTER_WEBHOOK_URL', 'https://andter.com/i/prestashop/webhook/xxx'); }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->registerHook('header') && Configuration::updateValue('FKVSEOTK_HREFLANG_ENABLED', false) && Configuration::updateValue('FKVSEOTK_CANONICAL_ENABLED', false) && Configuration::updateValue('FKVSEOTK_NOBOTS_ENABLED', false); }
/** * @return boolean */ public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } // Install invisible tab $tab = new Tab(); $tab->name[$this->context->language->id] = $this->l('SecurionPay'); $tab->class_name = 'AdminSecurionPay'; $tab->id_parent = -1; // No parent tab $tab->module = $this->name; $tab->add(); //Init Configuration::updateValue('SECURIONPAY_CONF', ''); if (!parent::install()) { return false; } if (!Configuration::updateValue(self::MODE, self::MODE_TEST)) { return false; } if (!$this->registerHook('payment') || !$this->registerHook('displayAdminOrder')) { return false; } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->registerHook('lampAccessories') && $this->registerHook('header') && Configuration::updateValue('LAMPACCESSORIES_NAME', 'Lamp Accessories'); }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->registerHook('invoice') && $this->registerHook('payment') && $this->registerHook('paymentReturn') && $this->createDebitNoteTable() && $this->createOrderState() && Configuration::updateValue('DEBITNOTE_CREDITOR_IDENTIFIER', DEXXXX); }
public function install() { if (version_compare(_PS_VERSION_, '1.5', '>=') && Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->installTab() || !$this->registerHook('header') || !$this->registerHook('adminOrder') || !$this->registerHook('footer') || !$this->registerHook('home') || !$this->registerHook('productfooter') || !$this->registerHook('orderConfirmation') || !$this->registerHook('backOfficeHeader')) { return false; } if (version_compare(_PS_VERSION_, '1.5', '>=') && (!$this->registerHook('actionProductCancel') || !$this->registerHook('actionCartSave'))) { return false; } Db::getInstance()->Execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'ganalytics`'); if (!Db::getInstance()->Execute(' CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ganalytics` ( `id_google_analytics` int(11) NOT NULL AUTO_INCREMENT, `id_order` int(11) NOT NULL, `id_customer` int(10) NOT NULL, `id_shop` int(11) NOT NULL, `sent` tinyint(1) DEFAULT NULL, `date_add` datetime DEFAULT NULL, PRIMARY KEY (`id_google_analytics`), KEY `id_order` (`id_order`), KEY `sent` (`sent`) ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1')) { return $this->uninstall(); } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->registerHook('displayShoppingCartFooter') && $this->registerHook('header') && $this->registerHook('displayFooterProduct') && Configuration::updateValue('CUSTOMGIFT_PRODUCTID', '0'); }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } // Hooks & Install return parent::install() && $this->prepareModuleSettings() && $this->registerHook('moduleRoutes') && $this->registerHook('displaySimpleBlogPosts') && $this->registerHook('displaySimpleBlogCategories') && $this->registerHook('displayHeader') && $this->registerHook('displayTop') && $this->registerHook('displayBackOfficeHeader') && $this->registerHook('displayAdminHomeQuickLinks') && $this->registerHook('displayPrestaHomeBlogAfterPostContent') && $this->registerHook('displayLeftColumn'); }
/** * @author Linus Lundevall <*****@*****.**> */ public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } return parent::install() && $this->installDB() && $this->registerHook('displayBackOfficeHeader') && $this->registerHook('productTabContent'); // $this->registerHook('displayFooterProduct') && //displayRightColumnProduct }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('header') || !Configuration::updateValue('MYMODULE_NAME', 'my friend') || !$this->installModuleTab('Intercambio', array(1 => 'Ordenes de intercambio'), 0)) { return false; } return true; }
/** * Install the module and register the hooks * @return bool */ public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('productfooter') || !$this->registerHook('header') || !Configuration::updateValue('BLOCKPRODUCTMANUFACTURER_NAME', 'Block Product Manufacturer')) { return false; } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('displayPrestaEbooks') || !$this->registerHook('displayAdminProductsExtra') || !$this->registerHook('displayBackOfficeHeader') || !$this->registerHook('displayHeader') || !$this->registerHook('displayCustomerAccount') || !$this->installDb() || !$this->installDefaultConfigValues()) { return false; } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() or !$this->registerHook('displayHeader') or !$this->registerHook('displayCarrierList') or !$this->registerHook('actionValidateOrder') or !$this->registerHook('actionObjectCarrierUpdateAfter') or !Configuration::updateValue('STORE_DELIVERY_SEND_MAIL', '0') or !Configuration::updateValue('STORE_DELIVERY_CARRIER', '') or !Configuration::updateValue('STORE_DELIVERY_CARRIER_REFERENCE', '') or !Configuration::updateValue('STORE_DELIVERY_DISPLAY_MAP', '1') or !Configuration::updateValue('STORE_DELIVERY_HEIGHT_MAP', '300px') or !Configuration::updateValue('STORE_DELIVERY_WIDTH_MAP', '725px')) { return false; } return true; }
/** * Module install method * -- * @return boolean */ public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('header') || !Configuration::updateValue('GOOGLE_CONNECT_CLIENT_ID', '') || !Configuration::updateValue('GOOGLE_CONNECT_CLIENT_SECRET', '') || !Configuration::updateValue('GOOGLE_CONNECT_CALLBACK_URL', '')) { return false; } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() && !$this->registerHook('leftColumn') && !$this->registerHook('header') && !Configuration::updateValue('PSMODULE_NAME', 'Test PS-Module')) { return false; } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('displayHeader') || !$this->registerHook('createAccountTop') || !Configuration::updateValue('DADATA_SUGGESTIONS_TOKEN', '') || !Configuration::updateValue('DADATA_SUGGESTIONS_COUNT', 10) || !Configuration::updateValue('DADATA_SUGGESTIONS_HIDE', true) || !Configuration::updateValue('DADATA_SUGGESTIONS_URL', 'free') || !Configuration::updateValue('DADATA_SUGGESTIONS_FIO', true) || !Configuration::updateValue('DADATA_SUGGESTIONS_ADDRESS', true) || !Configuration::updateValue('DADATA_SUGGESTIONS_TRIG_SEL_SPC', true) || !Configuration::updateValue('DADATA_SUGGESTIONS_REGION_FIELD', 'id_state')) { return false; } return true; }
public function install() { //context feature only works in ps 1.5 or higher if (_PS_VERSION_ >= '1.5') { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } } /* set default values when installing */ return parent::install() && Configuration::updateValue('ELEVATEZOOM_PRODUCT', 1) && Configuration::updateValue('ELEVATEZOOM_ZOOM_TYPE', 'inner') && Configuration::updateValue('ELEVATEZOOM_FADE_IN', 400) && Configuration::updateValue('ELEVATEZOOM_FADE_OUT', 550) && Configuration::updateValue('ELEVATEZOOM_WINDOW_POS', 1) && Configuration::updateValue('ELEVATEZOOM_SCROLL', 'false') && Configuration::updateValue('ELEVATEZOOM_EASING', 'true') && Configuration::updateValue('ELEVATEZOOM_CURSOR_TYPE', 'crosshair') && Configuration::updateValue('ELEVATEZOOM_TINT', 'false') && Configuration::updateValue('ELEVATEZOOM_TINT_COLOR', '#333') && Configuration::updateValue('ELEVATEZOOM_TINT_OPACITY', 0.4) && Configuration::updateValue('ELEVATEZOOM_LENS_SHAPE', 'square') && Configuration::updateValue('ELEVATEZOOM_LENS_SIZE', 200) && Configuration::updateValue('ELEVATEZOOM_EXTRA_PARAMS', '') && Configuration::updateValue('ELEVATEZOOM_OTHER', 0) && Configuration::updateValue('ELEVATEZOOM_OTHER_CODE', '$("a.product_image img").elevateZoom({zoomType : "lens", lensShape : "round", lensSize : 200});') && $this->registerHook('header'); //install and register the module on header hook }
function upgrade_module_1_2_2_7($object) { Shop::setContext(Shop::CONTEXT_ALL); /** Possibility to set meta_title other then title **/ Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'simpleblog_post_lang` ADD title VARCHAR(255) NOT NULL AFTER id_lang'); Db::getInstance()->query('UPDATE `' . _DB_PREFIX_ . 'simpleblog_post_lang` spl, `' . _DB_PREFIX_ . 'simpleblog_post_lang` spl2 SET spl.title = spl2.meta_title WHERE spl.id_simpleblog_post = spl2.id_simpleblog_post'); return true; }
public function initializeContext() { global $smarty; Context::getContext()->shop = new Shop(1); Shop::setContext(Shop::CONTEXT_SHOP, 1); Configuration::loadConfiguration(); Context::getContext()->language = new Language(Configuration::get('PS_LANG_DEFAULT')); Context::getContext()->country = new Country('PS_COUNTRY_DEFAULT'); Context::getContext()->cart = new Cart(); define('_PS_SMARTY_FAST_LOAD_', true); require_once _PS_ROOT_DIR_ . '/config/smarty.config.inc.php'; Context::getContext()->smarty = $smarty; }
/** * Returns the shop address * @return string */ protected function getShopAddress() { $shop_address = ''; if (Validate::isLoadedObject($this->shop)) { Shop::setContext(Shop::CONTEXT_SHOP, $this->shop->id); $shop_address_obj = $this->shop->getAddress(); if (isset($shop_address_obj) && $shop_address_obj instanceof Address) { $shop_address = AddressFormat::generateAddress($shop_address_obj, array(), ' - ', ' '); } return $shop_address; } return $shop_address; }
/** * Default installation process. * * @return bool */ public function install() { // check if multistore option is enabled, // if enabled, set the current context to // all shops on this installation of Prestashop. if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } // parent class installed? if (!parent::install() || !$this->registerHook('paymentReturn')) { return false; } return true; }
/** * Runs the BluePay installation process */ public function install() { include_once _PS_MODULE_DIR_ . '/bluepay/bluepay_install.php'; if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!function_exists('curl_version')) { return 'Error: Curl not installed.'; } $bluepay_install = new BluePayInstall(); $bluepay_install->createTables(); $bluepay_install->updateConfiguration(); $bluepay_install->createOrderState(); return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('displayHeader') && $this->registerHook('displayBackOfficeHeader') && $this->registerHook('displayPayment') && $this->registerHook('displayOrderConfirmation') && $this->registerHook('actionProductCancel') && $this->registerHook('displayAdminOrder'); }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('header') || !Configuration::updateValue('MYMODULE_NAME', 'my friend')) { return false; } $sql = array(); require_once dirname(__FILE__) . '/sql/install.php'; foreach ($sql as $sq) { if (!Db::getInstance()->Execute($sq)) { return false; } } return true; }
/** * Creates settings in database. * * @return boolean Operation result (true if success). */ public function install() { if (!parent::install()) { return false; } if (!$this->registerHooks(array('displayPayment', 'displayPaymentReturn'))) { return false; } if (!$this->createPaynetPaymentsTable()) { return false; } if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!$this->saveConfig()) { return false; } return true; }
public function install() { if (Shop::isFeatureActive()) { Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install()) { return false; } Db::getInstance()->execute("ALTER TABLE `" . _DB_PREFIX_ . "customized_data` CHANGE `value` `value` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;"); $_pKey = Configuration::get(PITCHPRINT_API_KEY); $_pSec = Configuration::get(PITCHPRINT_SECRET_KEY); $_pDes = Configuration::get(PITCHPRINT_P_DESIGNS); if (empty($_pKey)) { Configuration::updateValue(PITCHPRINT_API_KEY, ''); } if (empty($_pSec)) { Configuration::updateValue(PITCHPRINT_SECRET_KEY, ''); } if (empty($_pDes)) { Configuration::updateValue(PITCHPRINT_P_DESIGNS, serialize(array())); } return $this->registerHook('displayProductButtons') && $this->registerHook('displayHeader') && $this->registerHook('displayAdminOrder') && $this->registerHook('displayBackOfficeHeader') && $this->registerHook('actionProductUpdate') && $this->registerHook('displayAdminProductsExtra'); }