当前位置: 首页>>代码示例>>PHP>>正文


PHP Shop::setContext方法代码示例

本文整理汇总了PHP中Shop::setContext方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::setContext方法的具体用法?PHP Shop::setContext怎么用?PHP Shop::setContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shop的用法示例。


在下文中一共展示了Shop::setContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initializeContext

 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;
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:31,代码来源:process.php

示例2: install

 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');
 }
开发者ID:sebastien-fauvel,项目名称:prestashop-new-order-webhook,代码行数:7,代码来源:neworderwebhook.php

示例3: install

 public function install()
 {
     if (Shop::isFeatureActive()) {
         Shop::setContext(Shop::CONTEXT_ALL);
     }
     return parent::install() && $this->registerHook('actionObjectCustomerUpdateAfter') && $this->registerHook('actionObjectCustomerUpdateBefore');
 }
开发者ID:netvisiontec,项目名称:Prestashop,代码行数:7,代码来源:customerupdatenotification.php

示例4: install

 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;
     }
 }
开发者ID:prestamodule,项目名称:erpillicopresta,代码行数:32,代码来源:erpillicopresta.php

示例5: install

 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;
 }
开发者ID:noveni,项目名称:importmodule,代码行数:29,代码来源:importer.php

示例6: install

 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');
 }
开发者ID:aztetic,项目名称:prestashop,代码行数:7,代码来源:andter.php

示例7: install

 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);
 }
开发者ID:zizuu-store,项目名称:zzseotk,代码行数:7,代码来源:faktiva_seo_tk.php

示例8: install

 /**
  * @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;
 }
开发者ID:securionpay,项目名称:securionpay-prestashop,代码行数:29,代码来源:SecurionPay.php

示例9: install

 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);
 }
开发者ID:sigma001,项目名称:prestashop-debitnote,代码行数:7,代码来源:debitnote.php

示例10: install

    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;
    }
开发者ID:pierreavizou,项目名称:ganalytics,代码行数:28,代码来源:ganalytics.php

示例11: install

 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');
 }
开发者ID:PapaPingouin,项目名称:nmcutsomgift,代码行数:7,代码来源:nmcustomgift.php

示例12: install

 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');
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:8,代码来源:ph_simpleblog.php

示例13: install

 /**
  * @author Linus Lundevall <developer@prettypegs.com>
  */
 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
 }
开发者ID:crowdingdev,项目名称:product_description_customizer_module,代码行数:12,代码来源:productdescriptioncustomizer.php

示例14: install

 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;
 }
开发者ID:TheTypoMaster,项目名称:neotienda,代码行数:10,代码来源:intercambio.php

示例15: install

 /**
  * 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;
 }
开发者ID:angelomaragna,项目名称:prestashop-blockproductmanufacturer,代码行数:14,代码来源:blockproductmanufacturer.php


注:本文中的Shop::setContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。