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


PHP Mage_Core_Model_App::getWebsite方法代码示例

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


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

示例1: getStoreGroups

 /**
  * Get store groups for specified website
  *
  * @param Mage_Core_Model_Website|int $website
  * @return array
  */
 public function getStoreGroups($website)
 {
     if (!$website instanceof Mage_Core_Model_Website) {
         $website = $this->_application->getWebsite($website);
     }
     return $website->getGroups();
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:13,代码来源:Switcher.php

示例2: getStoresInfo

 /**
  * Get configuration for stores base urls.
  *
  * array(
  *  $index => array(
  *      'store_id'  => $storeId,
  *      'base_url'  => $url,
  *      'cookie'    => $cookie
  *  )
  * )
  *
  * @return array
  */
 public function getStoresInfo()
 {
     $baseUrls = array();
     foreach ($this->_app->getStores() as $store) {
         /** @var $store Mage_Core_Model_Store */
         $website = $this->_app->getWebsite($store->getWebsiteId());
         if ($website->getIsStaging() || Mage::helper('enterprise_websiterestriction')->getIsRestrictionEnabled($store)) {
             continue;
         }
         $baseUrl = $this->_app->getStore($store)->getBaseUrl();
         $defaultCurrency = $this->_app->getStore($store)->getDefaultCurrencyCode();
         $defaultWebsiteStore = $website->getDefaultStore();
         $defaultWebsiteBaseUrl = $defaultWebsiteStore->getBaseUrl();
         $cookie = '';
         if ($baseUrl == $defaultWebsiteBaseUrl && $defaultWebsiteStore->getId() != $store->getId()) {
             $cookie = 'store=' . $store->getCode() . ';';
         }
         $baseUrls[] = array('store_id' => $store->getId(), 'base_url' => $baseUrl, 'cookie' => $cookie);
         if ($store->getConfig(self::XML_PATH_CRAWL_MULTICURRENCY) && $store->getConfig(Enterprise_PageCache_Model_Processor::XML_PATH_CACHE_MULTICURRENCY)) {
             $currencies = $store->getAvailableCurrencyCodes(true);
             foreach ($currencies as $currencyCode) {
                 if ($currencyCode != $defaultCurrency) {
                     $baseUrls[] = array('store_id' => $store->getId(), 'base_url' => $baseUrl, 'cookie' => $cookie . 'currency=' . $currencyCode . ';');
                 }
             }
         }
     }
     return $baseUrls;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:42,代码来源:Crawler.php

示例3: getDefaultCurrency

 /**
  * Retrieve default currency for selected store, website or website group
  *
  * @param Mage_Core_Controller_Request_Http $request
  * @return string
  */
 public function getDefaultCurrency(Mage_Core_Controller_Request_Http $request)
 {
     if ($request->getParam('store')) {
         $store = $request->getParam('store');
         $currencyCode = $this->_app->getStore($store)->getBaseCurrencyCode();
     } else {
         if ($request->getParam('website')) {
             $website = $request->getParam('website');
             $currencyCode = $this->_app->getWebsite($website)->getBaseCurrencyCode();
         } else {
             if ($request->getParam('group')) {
                 $group = $request->getParam('group');
                 $currencyCode = $this->_app->getGroup($group)->getWebsite()->getBaseCurrencyCode();
             } else {
                 $currencyCode = $this->_app->getStore()->getBaseCurrencyCode();
             }
         }
     }
     return $currencyCode;
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:26,代码来源:DefaultLocator.php

示例4: testGetWebsiteNonExisting

 /**
  * @expectedException Mage_Core_Exception
  */
 public function testGetWebsiteNonExisting()
 {
     $this->assertNotEmpty($this->_mageModel->getWebsite()->getId());
     $this->_mageModel->getWebsite(100);
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:AppTest.php

示例5: getImgUrl

 /**
  * Get captcha image base URL
  *
  * @param mixed $website
  * @return string
  */
 public function getImgUrl($website = null)
 {
     return $this->_app->getStore()->getBaseUrl('media') . 'captcha' . '/' . $this->_app->getWebsite($website)->getCode() . '/';
 }
开发者ID:,项目名称:,代码行数:10,代码来源:


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