當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。