本文整理汇总了PHP中Mage_Core_Model_Store::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Store::getName方法的具体用法?PHP Mage_Core_Model_Store::getName怎么用?PHP Mage_Core_Model_Store::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Store
的用法示例。
在下文中一共展示了Mage_Core_Model_Store::getName方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateFeed
public function generateFeed()
{
/** @var $stores Mage_Core_Model_Store[] */
$stores = Mage::app()->getStores();
$this->log("Config element: {$this->_configPath}");
$this->log("Found " . count($stores) . " stores - starting to process.");
foreach ($stores as $this->_store) {
if (!Mage::getStoreConfig('mehulchaudhari_feedsgenerator/' . $this->_configPath . '/active', $this->_store->getId())) {
$this->log("Store: {$this->_store->getName()} disabled, not processing");
} else {
// get and store attribute mapping
$this->setupAppData();
$this->_attributes = $this->collectAttributeMapping();
$this->log("Processing store: {$this->_store->getName()}");
if ($this->_generateProductCategory) {
// Create the entire products xml file
$this->batchProcessStore();
// Create for each leaf category, their products xml file
$categories = $this->getCategoriesXml();
foreach ($categories['link_ids'] as $categoryId) {
$this->log('Generating Product Category XML File: ' . $categoryId);
$this->batchProcessStore($categoryId);
}
} else {
$this->batchProcessStore();
}
}
}
$this->finaliseAppData();
$this->log('Finished update function');
}
示例2: export
public function export(Mage_Core_Model_Store $oStore, $vFeedname, Mage_Core_Model_Config_Element $oConfig)
{
Mage::getSingleton('aligent_feeds/log')->log("Beginning {$vFeedname} export for store #" . $oStore->getId() . " - " . $oStore->getName());
Mage::getSingleton('aligent_feeds/log')->logMemoryUsage();
Mage::getSingleton('aligent_feeds/log')->log("Initialising file writers...");
$this->_initWriters($oStore, $vFeedname, $oConfig);
// Prepare the csv file header
Mage::getSingleton('aligent_feeds/log')->log("Begin preparing header rows...");
Mage::getSingleton('aligent_feeds/log')->logMemoryUsage();
$this->_prepareHeaders($oConfig);
// Initialise the formatter
Mage::getSingleton('aligent_feeds/log')->log("Initialising Feed Formatter...");
Mage::getSingleton('aligent_feeds/feed_formatter')->init($oStore, $oConfig);
Mage::getSingleton('aligent_feeds/log')->log("Initialised Feed Formatter.");
Mage::getSingleton('aligent_feeds/log')->logMemoryUsage();
$oConn = Mage::getModel('core/resource')->getConnection('catalog_read');
$vCategoryProductTable = Mage::getModel('core/resource_setup', 'core_setup')->getTable('catalog/category_product');
$vCategoryFlatTable = Mage::getResourceSingleton('catalog/category_flat')->getMainStoreTable($oStore->getId());
$vProductFlatTable = Mage::getResourceModel('catalog/product_flat_indexer')->getFlatTableName($oStore->getId());
// Complicated subquery to get the most deeply nested category that this
// product is assigned to. Picking the most deeply nested on the assumption
// that the deepest category is most likely to be the most specific.
$oSubSelect = new Varien_Db_Select($oConn);
$oSubSelect->from(array('ccf' => $vCategoryFlatTable), 'entity_id')->joinInner(array('ccp2' => 'catalog_category_product'), 'ccf.entity_id=ccp2.category_id', array())->where('ccp2.product_id=main_table.entity_id')->where('ccf.is_active=1')->order('level', Zend_Db_Select::SQL_DESC)->limit(1);
$oSelect = new Varien_Db_Select($oConn);
$oSelect->from(array('main_table' => $vProductFlatTable), array('main_table.*', 'category_id' => new Zend_Db_Expr('(' . $oSubSelect . ')')))->where('visibility IN (?)', array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG, Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH));
// Allow the feed definition to include a "before_query_filter". This method
// will be allowed to modify the query before it's executed.
if ($oConfig->before_query_filter) {
Mage::getSingleton('aligent_feeds/log')->log("Calling before query filter...");
$vClass = (string) $oConfig->before_query_filter->class;
$vMethod = (string) $oConfig->before_query_filter->method;
$aParams = (array) $oConfig->before_query_filter->params;
Mage::getSingleton($vClass)->{$vMethod}($oSelect, $oStore, $aParams);
Mage::getSingleton('aligent_feeds/log')->log("Before query filter done.");
}
Mage::getSingleton('aligent_feeds/log')->log("Exporting products...");
$oResource = Mage::getModel('core/resource_iterator')->walk($oSelect, array(function ($aArgs) {
Mage::getSingleton('aligent_feeds/log')->log("Exporting product #" . $aArgs['idx'] . " SKU: " . $aArgs['row']['sku'], Zend_Log::DEBUG, true);
if ($aArgs['idx'] % 100 == 0) {
Mage::getSingleton('aligent_feeds/log')->log("Exporting product #" . $aArgs['idx'] . "...", Zend_Log::INFO);
Mage::getSingleton('aligent_feeds/log')->logMemoryUsage();
}
$aRows = Mage::getSingleton('aligent_feeds/feed_formatter')->prepareRow($aArgs['row']);
if (count($aRows) > 0) {
foreach ($aRows as $aRow) {
foreach ($aArgs['writers'] as $oWriter) {
$oWriter->writeDataRow($aRow);
}
}
}
}), array('writers' => $this->_oWriters, 'config' => $oConfig, 'store' => $oStore));
$this->_closeWriters();
$this->_sendFeed();
Mage::getSingleton('aligent_feeds/status')->addSuccess("Generated {$vFeedname} data for store #" . $oStore->getId() . " - " . $oStore->getName());
Mage::getSingleton('aligent_feeds/log')->log("Finished {$vFeedname} data export for store #" . $oStore->getId() . " - " . $oStore->getName());
Mage::getSingleton('aligent_feeds/log')->logMemoryUsage();
return $this;
}
示例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", $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());
}
}
示例4: 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());
}
}
示例5: generateSettingsShop
/**
* @param $config
* @return Payone_Settings_Data_ConfigFile_Abstract|Payone_Settings_Data_ConfigFile_Shop
*/
protected function generateSettingsShop($config)
{
/** @var $shopConfig Payone_Settings_Data_ConfigFile_Shop */
$shopConfig = $this->getSettingsClass('shop');
$helper = $this->helper();
$shopCode = $this->store->getCode();
$shopName = $this->store->getName();
$shopConfig->setCode($shopCode);
$shopConfig->setName($shopName);
$systemConfig = $this->generateSettingsSystem();
$shopConfig->setSystem($systemConfig);
$globalConfig = $this->generateSettingsGlobal($config);
$shopConfig->setGlobal($globalConfig);
$clearingtypesConfig = $this->generateSettingsClearingtypes($config);
$shopConfig->setClearingtypes($clearingtypesConfig);
$protectConfig = $this->generateSettingsProtect($config);
$shopConfig->setProtect($protectConfig);
$miscConfig = $this->generateSettingsMisc($config);
$shopConfig->setMisc($miscConfig);
return $shopConfig;
}
示例6: 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);
}
}
}
示例7: _initStoreView
/**
* Init Staging Store Views
*
* @param Varien_Data_Form $fieldset
* @param Mage_Core_Model_Store $storeView
* @param Mage_Core_Model_Website $stagingWebsite
* @return Enterprise_Staging_Block_Manage_Staging_Edit_Tabs_Website
*/
protected function _initStoreView($fieldset, $storeView, $stagingWebsite = null)
{
$_shift = str_repeat(' ', 6);
if (!$stagingWebsite) {
$_id = $storeView->getId();
$websiteId = $storeView->getWebsiteId();
$fieldset->addField('master_store_use_' . $_id, 'checkbox', array('label' => $_shift . $storeView->getName(), 'name' => "websites[{$websiteId}][stores][{$_id}][use]", 'value' => $storeView->getId(), 'checked' => true));
$fieldset->addField('master_store_id_' . $_id, 'hidden', array('label' => Mage::helper('enterprise_staging')->__('Master Store ID'), 'name' => "websites[{$websiteId}][stores][{$_id}][master_store_id]", 'value' => $storeView->getId()));
$fieldset->addField('master_store_code_' . $_id, 'hidden', array('label' => Mage::helper('enterprise_staging')->__('Master Store Code'), 'name' => "websites[{$websiteId}][stores][{$_id}][master_store_code]", 'value' => $storeView->getCode()));
$fieldset->addField('staging_store_code_' . $_id, 'hidden', array('label' => Mage::helper('enterprise_staging')->__('Staging Store Code'), 'name' => "websites[{$websiteId}][stores][{$_id}][code]", 'value' => Mage::helper('enterprise_staging/store')->generateStoreCode($storeView->getCode())));
$fieldset->addField('staging_store_name_' . $_id, 'hidden', array('label' => Mage::helper('enterprise_staging')->__('Staging Store Name'), 'name' => "websites[{$websiteId}][stores][{$_id}][name]", 'value' => $storeView->getName()));
} else {
$fieldset->addField('staging_store_' . $storeView->getId(), 'label', array('label' => $_shift . $storeView->getName()));
}
return $this;
}
示例8: _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()];
}
示例9: 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;
}
}
示例10: _buildStore
/**
* Builds a record for a given store
*
* @param Mage_Core_Model_Store $store
* @return array
*/
protected function _buildStore(Mage_Core_Model_Store $store)
{
$locale = preg_split('/_/', $store->getConfig('general/locale/code'));
return array('webStoreName' => $store->getName(), 'webStoreId' => $store->getStoreId(), 'language' => $locale[1], 'currencyCode' => $store->getCurrentCurrencyCode(), 'url' => $store->getUrl());
}
示例11: 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;
}
示例12: processStore
/**
* Process the given store.
*
* @param UrlTransformer $transformer
* @param \Mage_Core_Model_Store $store
* @param OutputInterface $output
* @return void
*/
protected function processStore(UrlTransformer $transformer, \Mage_Core_Model_Store $store, OutputInterface $output)
{
if ($output->getVerbosity() >= $output::VERBOSITY_VERBOSE) {
$output->writeln("<comment>{$store->getCode()}</comment> " . "<info>{$store->getName()}</info> " . "- {$store->getFrontendName()}");
}
$output->writeln($transformer->createDomain($store));
$rewrites = $transformer->rewriteStore($store);
if ($output->getVerbosity() >= $output::VERBOSITY_VERBOSE) {
foreach ($rewrites as $xpath => $baseUrl) {
$output->writeln("\t<info>{$xpath}</info> => {$baseUrl}");
}
}
}
示例13: getStoreViewLanguage
/**
* get the storeview language/country code (en-US, fr-FR)
* @param Mage_Core_Model_Store $store
* @return string|null
*/
public function getStoreViewLanguage(Mage_Core_Model_Store $store)
{
$storeCodeParsed = explode('_', $store->getName(), 3);
if (count($storeCodeParsed) > 2) {
return strtolower(Mage::helper('eb2ccore')->mageToXmlLangFrmt($storeCodeParsed[2]));
}
return null;
}