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


PHP Shop::cacheShops方法代码示例

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


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

示例1: getSites

 /**
  * Get all site information - both Jirafe specific and general
  * @return array $sites An array of site information as per Jirafe API spec
  */
 public function getSites()
 {
     $sites = array();
     // First, get the general site info from the Prestashop database
     Shop::cacheShops(true);
     // we must refresh cache to get last insertion
     $psShops = Shop::getShops();
     // Get the Jirafe specific information about Prestashop sites
     $jsites = unserialize(base64_decode($this->get('sites')));
     if (!empty($psShops)) {
         foreach ($psShops as $psShop) {
             if ($psShop['active']) {
                 $shopId = $psShop['id_shop'];
                 $site = array();
                 $site['external_id'] = $shopId;
                 $site['description'] = $psShop['name'];
                 $site['url'] = 'http://' . $psShop['domain'] . $psShop['uri'];
                 $site['timezone'] = Configuration::get('PS_TIMEZONE');
                 $site['currency'] = $this->_getCurrency($shopId);
                 if (!empty($jsites[$shopId])) {
                     $site += $jsites[$shopId];
                 }
                 // new sites in prestashop are created without url
                 // api require a valid unique url
                 if ($site['url'] === 'http://') {
                     $site['url'] = 'http://example.' . md5(time() + $site['external_id']) . '.com';
                 }
                 // Add the site to the list of sites to return
                 $sites[] = $site;
             }
         }
     }
     return $sites;
 }
开发者ID:bunnywong,项目名称:isnatura.com.hk,代码行数:38,代码来源:Prestashop15.php

示例2: getTree

 /**
  * Get all groups and associated shops as subarrays
  *
  * @return array
  */
 public static function getTree()
 {
     Shop::cacheShops();
     return self::$shops;
 }
开发者ID:gks-stage,项目名称:prestashop,代码行数:10,代码来源:Shop.php

示例3: array

    } else {
        $domains = null;
        if ($context->shop->domain != $context->shop->domain_ssl) {
            $domains = array($context->shop->domain_ssl, $context->shop->domain);
        }
        $cookie = new Cookie('ps-s' . $context->shop->id, '', $cookie_lifetime, $domains, false, $force_ssl);
    }
}
$context->cookie = $cookie;
/* Create employee if in BO, customer else */
if (defined('_PS_ADMIN_DIR_')) {
    $employee = new Employee($cookie->id_employee);
    $context->employee = $employee;
    /* Auth on shops are recached after employee assignation */
    if ($employee->id_profile != _PS_ADMIN_PROFILE_) {
        Shop::cacheShops(true);
    }
    $cookie->id_lang = (int) $employee->id_lang;
}
/* if the language stored in the cookie is not available language, use default language */
if (isset($cookie->id_lang) && $cookie->id_lang) {
    $language = new Language($cookie->id_lang);
}
if (!isset($language) || !Validate::isLoadedObject($language)) {
    $language = new Language(Configuration::get('PS_LANG_DEFAULT'));
}
$context->language = $language;
if (!defined('_PS_ADMIN_DIR_')) {
    if (isset($cookie->id_customer) && (int) $cookie->id_customer) {
        $customer = new Customer($cookie->id_customer);
        if (!Validate::isLoadedObject($customer)) {
开发者ID:evgrishin,项目名称:mh16014,代码行数:31,代码来源:config.inc.php


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