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


PHP Mage_Core_Model_Store::getWebsite方法代码示例

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


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

示例1: _displayTable

 protected function _displayTable(OutputInterface $output, \Mage_Core_Model_Store $store)
 {
     $this->writeSection($output, 'Current design setting on store: ' . $store->getWebsite()->getCode() . '/' . $store->getCode());
     $storeInfoLines = $this->_parse($this->_configNodesWithExceptions, $store, true);
     $storeInfoLines = array_merge($storeInfoLines, $this->_parse($this->_configNodes, $store));
     $this->getHelper('table')->setHeaders(array('Parameter', 'Value'))->renderByFormat($output, $storeInfoLines);
     return $this;
 }
开发者ID:aedmonds,项目名称:n98-magerun,代码行数:8,代码来源:InfoCommand.php

示例2: createWebstore

 /**
  * Create a Klevu Webstore using the API for the given Magento store.
  *
  * @param                       $customer_id
  * @param Mage_Core_Model_Store $store
  * @param bool                  $test_mode
  *
  * @return array An array with the following keys:
  *                 success: boolean value indicating whether the operation was successful.
  *                 webstore: (success only) Varien_Object containing Webstore information.
  *                 message: message to be displayed to the user.
  */
 public function createWebstore($customer_id, Mage_Core_Model_Store $store, $test_mode = false)
 {
     $name = sprintf("%s - %s - %s", $store->getWebsite()->getName(), $store->getName(), $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
     $language = Mage::helper("klevu_search")->getStoreLanguage($store);
     $timezone = $store->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
     // Convert $test_mode to string
     $test_mode = $test_mode ? "true" : "false";
     $response = Mage::getModel("klevu_search/api_action_addwebstore")->execute(array("customerId" => $customer_id, "storeName" => $name, "language" => $language, "timezone" => $timezone, "testMode" => $test_mode));
     if ($response->isSuccessful()) {
         $webstore = new Varien_Object(array("store_name" => $name, "js_api_key" => $response->getJsApiKey(), "rest_api_key" => $response->getRestApiKey(), "test_account_enabled" => $test_mode));
         return array("success" => true, "webstore" => $webstore, "message" => $response->getMessage());
     } else {
         return array("success" => false, "message" => $response->getMessage());
     }
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:27,代码来源:Api.php

示例3: createWebstore

 /**
  * Create a Klevu Webstore using the API for the given Magento store.
  *
  * @param                       $customer_id
  * @param Mage_Core_Model_Store $store
  * @param bool                  $test_mode
  *
  * @return array An array with the following keys:
  *                 success: boolean value indicating whether the operation was successful.
  *                 webstore: (success only) Varien_Object containing Webstore information.
  *                 message: message to be displayed to the user.
  */
 public function createWebstore($customer_id, Mage_Core_Model_Store $store, $test_mode = false)
 {
     $name = sprintf("%s - %s - %s - %s", $store->getWebsite()->getName(), $store->getCode(), $store->getName(), $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
     $language = Mage::helper("klevu_search")->getStoreLanguage($store);
     $timezone = $store->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);
     $country = $store->getConfig(Mage_Core_Helper_Data::XML_PATH_DEFAULT_COUNTRY);
     $locale = $store->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE);
     $version = $this->getVersion();
     // Convert $test_mode to string
     $test_mode = $test_mode ? "true" : "false";
     $response = Mage::getModel("klevu_search/api_action_addwebstore")->execute(array("customerId" => $customer_id, "storeName" => $name, "language" => $language, "timezone" => $timezone, "version" => $version, "country" => $country, "locale" => $locale, "testMode" => $test_mode));
     if ($response->isSuccessful()) {
         $webstore = new Varien_Object(array("store_name" => $name, "js_api_key" => $response->getJsApiKey(), "rest_api_key" => $response->getRestApiKey(), "test_account_enabled" => $test_mode, "hosted_on" => $response->getHostedOn(), "cloud_search_url" => $response->getCloudSearchUrl(), "analytics_url" => $response->getAnalyticsUrl(), "js_url" => $response->getJsUrl(), "rest_hostname" => $response->getRestUrl()));
         return array("success" => true, "webstore" => $webstore, "message" => $response->getMessage());
     } else {
         return array("success" => false, "message" => $response->getMessage());
     }
 }
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:30,代码来源:Api.php

示例4: loadData

 /**
  * Loads the meta data for the given store.
  *
  * @param Mage_Core_Model_Store $store the store view to load the data for.
  */
 public function loadData(Mage_Core_Model_Store $store)
 {
     /* @var Nosto_Tagging_Helper_Data $helper */
     $helper = Mage::helper('nosto_tagging');
     $this->_title = $helper->cleanUpAccountTitle($store->getWebsite()->getName() . ' - ' . $store->getGroup()->getName() . ' - ' . $store->getName());
     $this->_name = substr(sha1(rand()), 0, 8);
     if (!$helper->getUsePrettyProductUrls()) {
         $this->_frontPageUrl = NostoHttpRequest::replaceQueryParamInUrl('___store', $store->getCode(), $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
     } else {
         $this->_frontPageUrl = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
     }
     $this->_currencyCode = $store->getBaseCurrencyCode();
     $this->_languageCode = substr($store->getConfig('general/locale/code'), 0, 2);
     $this->_ownerLanguageCode = substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2);
     /** @var Nosto_Tagging_Model_Meta_Account_Owner $owner */
     $owner = Mage::getModel('nosto_tagging/meta_account_owner');
     $owner->loadData();
     $this->_owner = $owner;
     /** @var Nosto_Tagging_Model_Meta_Account_Billing $billing */
     $billing = Mage::getModel('nosto_tagging/meta_account_billing');
     $billing->loadData($store);
     $this->_billing = $billing;
     $this->_useCurrencyExchangeRates = !$helper->multiCurrencyDisabled($store);
     if (!$helper->multiCurrencyDisabled($store)) {
         $this->_defaultPriceVariationId = $store->getBaseCurrencyCode();
     } else {
         $this->_defaultPriceVariationId = "";
     }
     $storeLocale = $store->getConfig('general/locale/code');
     $currencyCodes = $store->getAvailableCurrencyCodes(true);
     if (is_array($currencyCodes) && count($currencyCodes) > 0) {
         /** @var Nosto_Tagging_Helper_Currency $currencyHelper */
         $currencyHelper = Mage::helper('nosto_tagging/currency');
         foreach ($currencyCodes as $currencyCode) {
             $this->_currencies[$currencyCode] = $currencyHelper->getCurrencyObject($storeLocale, $currencyCode);
         }
     }
 }
开发者ID:nosto,项目名称:nosto-magento-extension,代码行数:43,代码来源:Account.php

示例5: setStore

 /**
  * Set store to customer
  *
  * @param Mage_Core_Model_Store $store
  * @return Mage_Customer_Model_Customer
  */
 public function setStore(Mage_Core_Model_Store $store)
 {
     $this->setStoreId($store->getId());
     $this->setWebsiteId($store->getWebsite()->getId());
     return $this;
 }
开发者ID:santhosh400,项目名称:ecart,代码行数:12,代码来源:Customer.php

示例6: _getFullStoreName

 /**
  * @param Mage_Core_Model_Store $store
  * @return string
  */
 protected function _getFullStoreName($store)
 {
     if (!isset($this->_fullStoreNames[$store->getId()])) {
         $fullStoreName = $store->getWebsite()->getName() . ' / ' . $store->getGroup()->getName() . ' / ' . $store->getName();
         $this->_fullStoreNames[$store->getId()] = $fullStoreName;
     }
     return $this->_fullStoreNames[$store->getId()];
 }
开发者ID:therouv,项目名称:AvS_ScopeHint,代码行数:12,代码来源:Hint.php

示例7: setupSession

 /**
  * Setup an API session for the given store. Sets the store and session ID on self. Returns
  * true on success or false if Product Sync is disabled, store is not configured or the
  * session API call fails.
  *
  * @param Mage_Core_Model_Store $store
  *
  * @return bool
  */
 protected function setupSession(Mage_Core_Model_Store $store)
 {
     $config = Mage::helper('klevu_search/config');
     if (!$config->isProductSyncEnabled($store->getId())) {
         $this->log(Zend_Log::INFO, sprintf("Disabled for %s (%s).", $store->getWebsite()->getName(), $store->getName()));
         return null;
     }
     $api_key = $config->getRestApiKey($store->getId());
     if (!$api_key) {
         $this->log(Zend_Log::INFO, sprintf("No API key found for %s (%s).", $store->getWebsite()->getName(), $store->getName()));
         return null;
     }
     $response = Mage::getModel('klevu_search/api_action_startsession')->execute(array('api_key' => $api_key, 'store' => $store));
     if ($response->isSuccessful()) {
         $this->addData(array('store' => $store, 'session_id' => $response->getSessionId()));
         return true;
     } else {
         $this->log(Zend_Log::ERR, sprintf("Failed to start a session for %s (%s): %s", $store->getWebsite()->getName(), $store->getName(), $response->getMessage()));
         if ($response instanceof Klevu_Search_Model_Api_Response_Empty) {
             /*$this->notify(
                   Mage::helper('klevu_search')->__(
                       "Product Sync failed for %s (%s): Could not contact Klevu.",
                       $store->getWebsite()->getName(),
                       $store->getName()
                   )
               );*/
         } else {
             $this->notify(Mage::helper('klevu_search')->__("Product Sync failed for %s (%s): %s", $store->getWebsite()->getName(), $store->getName(), $response->getMessage()));
         }
         return false;
     }
 }
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:41,代码来源:Sync.php

示例8: loadData

 /**
  * Loads the meta data for the given store.
  *
  * @param Mage_Core_Model_Store $store the store view to load the data for.
  */
 public function loadData(Mage_Core_Model_Store $store)
 {
     $this->_title = $store->getWebsite()->getName() . ' - ' . $store->getGroup()->getName() . ' - ' . $store->getName();
     $this->_name = substr(sha1(rand()), 0, 8);
     $this->_frontPageUrl = NostoHttpRequest::replaceQueryParamInUrl('___store', $store->getCode(), $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
     $this->_currencyCode = $store->getBaseCurrencyCode();
     $this->_languageCode = substr($store->getConfig('general/locale/code'), 0, 2);
     $this->_ownerLanguageCode = substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2);
     /** @var Nosto_Tagging_Model_Meta_Account_Owner $owner */
     $owner = Mage::getModel('nosto_tagging/meta_account_owner');
     $owner->loadData($store);
     $this->_owner = $owner;
     /** @var Nosto_Tagging_Model_Meta_Account_Billing $billing */
     $billing = Mage::getModel('nosto_tagging/meta_account_billing');
     $billing->loadData($store);
     $this->_billing = $billing;
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:22,代码来源:Account.php


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