本文整理汇总了PHP中Mage_Core_Model_Website::getStores方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Website::getStores方法的具体用法?PHP Mage_Core_Model_Website::getStores怎么用?PHP Mage_Core_Model_Website::getStores使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Website
的用法示例。
在下文中一共展示了Mage_Core_Model_Website::getStores方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetStores
public function testGetStores()
{
$stores = $this->_model->getStores();
$this->assertEquals(array(1), array_keys($stores));
$this->assertInstanceOf('Mage_Core_Model_Store', $stores[1]);
$this->assertEquals(1, $stores[1]->getId());
}
示例2: _getChangedStoresForWebsite
/**
* @param Mage_Core_Model_Website $website
* @return array
*/
protected function _getChangedStoresForWebsite($website)
{
$changedStores = array();
foreach ($website->getStores() as $store) {
/** @var Mage_Core_Model_Store $store */
if ($this->_isValueChanged($store, $website)) {
$changedStores[Mage::helper('scopehint')->__('Store View: %s', $this->_getFullStoreName($store))] = $this->_getReadableConfigValue($store);
}
}
return $changedStores;
}
示例3: _addWebsiteFieldset
/**
* Method add website fieldset to the form.
* @param Mage_Core_Model_Website $website
*/
private function _addWebsiteFieldset($website, $form)
{
$prefixWeb = 'website-' . $website->getCode();
/* make fieldset */
$layoutFieldset = $form->addFieldset($prefixWeb . '_fieldset', array('legend' => Mage::helper('mturbo')->__($website->getName() . ' settings'), 'class' => 'fieldset'));
/* add extra user control */
$layoutFieldset->addType('html_element', Artio_MTurbo_Helper_Data::FORM_HTML);
$layoutFieldset->addType('widget_button', Artio_MTurbo_Helper_Data::FORM_WIDGET_BUTTON);
/* indicator whether website is enabled */
$layoutFieldset->addField($prefixWeb . '-enabled', 'select', array('name' => $prefixWeb . '-enabled', 'label' => Mage::helper('mturbo')->__('Enable website') . ':', 'value' => '1', 'options' => array(0 => Mage::helper('mturbo')->__('No'), 1 => Mage::helper('mturbo')->__('Yes'))));
/* add field for turbopath */
$layoutFieldset->addField($prefixWeb . '-base_dir', 'text', array('name' => $prefixWeb . '-base_dir', 'value' => Mage::getBaseDir(), 'label' => Mage::helper('mturbo')->__('Base directory') . ':'));
/* add field for server name */
$layoutFieldset->addField($prefixWeb . '-server_name', 'text', array('name' => $prefixWeb . '-server_name', 'value' => Mage::helper('mturbo/website')->getServerName($website->getDefaultStore()->getCode()), 'label' => Mage::helper('mturbo')->__('Server name') . ':'));
/* every store has one select determines whether enabled is */
foreach ($website->getStores() as $store) {
if ($store->getIsActive()) {
$layoutFieldset->addField($prefixWeb . '-store-' . $store->getCode(), 'select', array('name' => $prefixWeb . '-store-' . $store->getCode(), 'label' => $store->getGroup()->getName() . '<br />' . $store->getName(), 'value' => '1', 'options' => array(0 => Mage::helper('mturbo')->__('No'), 1 => Mage::helper('mturbo')->__('Yes'))));
}
}
}
示例4: _afterPlainReindex
/**
* After plain reindex process
*
* @param Mage_Core_Model_Store|array|int|Mage_Core_Model_Website $store
* @param int|array|Mage_Catalog_Model_Product_Condition_Interface|Mage_Catalog_Model_Product $products
* @return Mage_CatalogIndex_Model_Indexer
*/
protected function _afterPlainReindex($store, $products = null)
{
Mage::dispatchEvent('catalogindex_plain_reindex_after', array('products' => $products));
/**
* Catalog Product Flat price update
*/
/** @var $productFlatHelper Mage_Catalog_Helper_Product_Flat */
$productFlatHelper = Mage::helper('catalog/product_flat');
if ($productFlatHelper->isAvailable() && $productFlatHelper->isBuilt()) {
if ($store instanceof Mage_Core_Model_Website) {
foreach ($store->getStores() as $storeObject) {
$this->_afterPlainReindex($storeObject->getId(), $products);
}
return $this;
} elseif ($store instanceof Mage_Core_Model_Store) {
$store = $store->getId();
} elseif (is_array($store)) {
foreach ($store as $storeObject) {
$this->_afterPlainReindex($storeObject->getId(), $products);
}
return $this;
}
$this->updateCatalogProductFlat($store, $products);
}
return $this;
}
示例5: _addWebsiteFieldset
/**
* Method add website fieldset to the form.
* @param Mage_Core_Model_Website $website
*/
private function _addWebsiteFieldset($website)
{
$prefixWeb = 'website-' . $website->getCode();
/* make fieldset */
$layoutFieldset = $this->form->addFieldset($prefixWeb . '_fieldset', array('legend' => $this->getMyHelper()->__($website->getName() . ' settings'), 'class' => 'fieldset'));
/* add extra user control */
$layoutFieldset->addType('html_element', Artio_MTurbo_Helper_Data::FORM_HTML);
$layoutFieldset->addType('widget_button', Artio_MTurbo_Helper_Data::FORM_WIDGET_BUTTON);
/* indicator whether website is enabled */
$layoutFieldset->addField($prefixWeb . '-enabled', 'select', array('name' => $prefixWeb . '-enabled', 'label' => $this->getMyHelper()->__('Enable website') . ':', 'options' => array(0 => $this->getMyHelper()->__('No'), 1 => $this->getMyHelper()->__('Yes'))));
/* add field for base dir */
$layoutFieldset->addField($prefixWeb . '-base_dir', 'text', array('name' => $prefixWeb . '-base_dir', 'label' => $this->getMyHelper()->__('Base directory') . ':'));
/* add field for server name */
$layoutFieldset->addField($prefixWeb . '-server_name', 'text', array('name' => $prefixWeb . '-server_name', 'label' => $this->getMyHelper()->__('Server name') . ':'));
$layoutFieldset->addField($prefixWeb . '_dec1', 'html_element', array('label' => '<h4>' . $this->getMyHelper()->__('Enable/Disable Storeview') . '</h4>', 'code' => '<div style="height:10px;border-bottom:1px solid #808080"></div>'));
/* every store has one select determines whether enabled is */
foreach ($website->getStores() as $store) {
if ($store->getIsActive()) {
$layoutFieldset->addField($prefixWeb . '-store-' . $store->getCode(), 'select', array('name' => $prefixWeb . '-store-' . $store->getCode(), 'label' => $store->getGroup()->getName() . '<br />' . $store->getName(), 'options' => array(0 => $this->getMyHelper()->__('No'), 1 => $this->getMyHelper()->__('Yes'))));
}
}
$layoutFieldset->addField($prefixWeb . '_dec2', 'html_element', array('label' => '<h4>' . $this->getMyHelper()->__('Htaccess settings') . '</h4>', 'code' => '<div style="height:10px;border-bottom:1px solid #808080"></div>'));
/* get htaccess state and set color by it */
$htaccess = Mage::getModel('mturbo/htaccess')->setWebsiteCode($website->getCode());
$state = '';
$pathToHtaccess = $htaccess->getPathToBaseHtaccess();
$color = Mage::helper('mturbo/functions')->get_file_state($pathToHtaccess, $state, 'ew') ? 'green' : 'red';
$layoutFieldset->addField($prefixWeb . '_dec3', 'html_element', array('label' => $this->getMyHelper()->__('File .htaccess path'), 'code' => '<span>' . $pathToHtaccess . '</span>'));
$edit = $htaccess->isEditedByMTurbo() ? 'yes' : 'no';
$layoutFieldset->addField($prefixWeb . '_dec5', 'html_element', array('label' => $this->getMyHelper()->__('Edited by MTurbo'), 'code' => '<span><b>' . $this->getMyHelper()->__($edit) . '</b></span>'));
$layoutFieldset->addField($prefixWeb . '_dec4', 'html_element', array('label' => $this->getMyHelper()->__('File .htaccess state'), 'code' => '<span style="color:' . $color . '">' . $this->getMyHelper()->__($state) . '</span>'));
/* button 'rebuild' show only if htaccess is ready */
if ($color == 'green') {
$layoutFieldset->addField($prefixWeb . '_htaccess_button', 'widget_button', array('name' => $prefixWeb . '_htaccess_button', 'label' => $this->getMyHelper()->__('Rebuild .htaccess for this website'), 'onclick' => "setLocation('" . Mage::helper('adminhtml')->getUrl('*/*/htaccessbuild', array('websitecode' => $website->getCode())) . "')"));
}
$layoutFieldset->addField($prefixWeb . '_urllist_button', 'widget_button', array('name' => $prefixWeb . '_urllist_button', 'label' => $this->getMyHelper()->__('Generate URL list for this website'), 'onclick' => "setLocation('" . Mage::helper('adminhtml')->getUrl('*/*/generateurllist', array('websitecode' => $website->getCode())) . "')"));
}