本文整理汇总了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();
}
示例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;
}
示例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;
}
示例4: testGetWebsiteNonExisting
/**
* @expectedException Mage_Core_Exception
*/
public function testGetWebsiteNonExisting()
{
$this->assertNotEmpty($this->_mageModel->getWebsite()->getId());
$this->_mageModel->getWebsite(100);
}
示例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() . '/';
}