本文整理汇总了PHP中AO::getStoreConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP AO::getStoreConfig方法的具体用法?PHP AO::getStoreConfig怎么用?PHP AO::getStoreConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AO
的用法示例。
在下文中一共展示了AO::getStoreConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _toHtml
protected function _toHtml()
{
$descrpt = AO::helper('core')->urlDecode($this->getRequest()->getParam('data'));
$data = explode(',', $descrpt);
$cid = (int) $data[0];
$rssObj = AO::getModel('rss/rss');
if ($cid) {
$customer = AO::getModel('customer/customer')->load($cid);
if ($customer && $customer->getId()) {
$wishlist = AO::getModel('wishlist/wishlist')->loadByCustomer($customer, true);
$newurl = AO::getUrl('wishlist/shared/index', array('code' => $wishlist->getSharingCode()));
$title = AO::helper('rss')->__('%s\'s Wishlist', $customer->getName());
$lang = AO::getStoreConfig('general/locale/code');
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8', 'language' => $lang);
$rssObj->_addHeader($data);
$collection = $wishlist->getProductCollection()->addAttributeToSelect('url_key')->addAttributeToSelect('name')->addAttributeToSelect('price')->addAttributeToSelect('thumbnail')->addAttributeToFilter('store_id', array('in' => $wishlist->getSharedStoreIds()))->load();
$product = AO::getModel('catalog/product');
foreach ($collection as $item) {
$product->unsetData()->load($item->getProductId());
$description = '<table><tr>' . '<td><a href="' . $item->getProductUrl() . '"><img src="' . $this->helper('catalog/image')->init($item, 'thumbnail')->resize(75, 75) . '" border="0" align="left" height="75" width="75"></a></td>' . '<td style="text-decoration:none;">' . $product->getDescription() . '<p> Price:' . AO::helper('core')->currency($product->getPrice()) . ($product->getPrice() != $product->getFinalPrice() ? ' Special Price:' . AO::helper('core')->currency($product->getFinalPrice()) : '') . ($item->getDescription() && $item->getDescription() != AO::helper('wishlist')->defaultCommentString() ? '<p>Comment: ' . $item->getDescription() . '<p>' : '') . '</td>' . '</tr></table>';
$data = array('title' => $product->getName(), 'link' => $product->getProductUrl(), 'description' => $description);
$rssObj->_addEntry($data);
}
}
} else {
$data = array('title' => AO::helper('rss')->__('Cannot retrieve the wishlist'), 'description' => AO::helper('rss')->__('Cannot retrieve the wishlist'), 'link' => AO::getUrl(), 'charset' => 'UTF-8');
$rssObj->_addHeader($data);
}
return $rssObj->createRssXml();
}
示例2: getCopyright
public function getCopyright()
{
if (!$this->_copyright) {
$this->_copyright = AO::getStoreConfig('design/footer/copyright');
}
return $this->_copyright;
}
示例3: _toHtml
protected function _toHtml()
{
$localeCode = AO::app()->getLocale()->getLocaleCode();
// get days names
$days = Zend_Locale_Data::getList($localeCode, 'days');
$this->assign('days', array('wide' => Zend_Json::encode(array_values($days['format']['wide'])), 'abbreviated' => Zend_Json::encode(array_values($days['format']['abbreviated']))));
// get months names
$months = Zend_Locale_Data::getList($localeCode, 'months');
$this->assign('months', array('wide' => Zend_Json::encode(array_values($months['format']['wide'])), 'abbreviated' => Zend_Json::encode(array_values($months['format']['abbreviated']))));
// get "today" and "week" words
$this->assign('today', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'relative', 0)));
$this->assign('week', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'field', 'week')));
// get "am" & "pm" words
$this->assign('am', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'am')));
$this->assign('pm', Zend_Json::encode(Zend_Locale_Data::getContent($localeCode, 'pm')));
// get first day of week and weekend days
$this->assign('firstDay', (int) AO::getStoreConfig('general/locale/firstday'));
$this->assign('weekendDays', Zend_Json::encode((string) AO::getStoreConfig('general/locale/weekend')));
// define default format and tooltip format
$this->assign('defaultFormat', Zend_Json::encode(AO::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM)));
$this->assign('toolTipFormat', Zend_Json::encode(AO::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_LONG)));
// get days and months for en_US locale - calendar will parse exactly in this locale
$days = Zend_Locale_Data::getList('en_US', 'days');
$months = Zend_Locale_Data::getList('en_US', 'months');
$enUS = new stdClass();
$enUS->m = new stdClass();
$enUS->m->wide = array_values($months['format']['wide']);
$enUS->m->abbr = array_values($months['format']['abbreviated']);
$this->assign('enUS', Zend_Json::encode($enUS));
return parent::_toHtml();
}
示例4: isStatusNotificationAllow
public function isStatusNotificationAllow()
{
if (AO::getStoreConfig('rss/order/status_notified')) {
return true;
}
return false;
}
示例5: isAllow
public function isAllow()
{
if (AO::getStoreConfig('sales/reorder/allow')) {
return true;
}
return false;
}
示例6: scheduledGenerateSitemaps
/**
* Generate sitemaps
*
* @param Mage_Cron_Model_Schedule $schedule
*/
public function scheduledGenerateSitemaps($schedule)
{
$errors = array();
// check if scheduled generation enabled
if (!AO::getStoreConfigFlag(self::XML_PATH_GENERATION_ENABLED)) {
return;
}
$collection = AO::getModel('sitemap/sitemap')->getCollection();
/* @var $collection Mage_Sitemap_Model_Mysql4_Sitemap_Collection */
foreach ($collection as $sitemap) {
/* @var $sitemap Mage_Sitemap_Model_Sitemap */
try {
$sitemap->generateXml();
} catch (Exception $e) {
$errors[] = $e->getMessage();
}
}
if ($errors && AO::getStoreConfig(self::XML_PATH_ERROR_RECIPIENT)) {
$translate = AO::getSingleton('core/translate');
/* @var $translate Mage_Core_Model_Translate */
$translate->setTranslateInline(false);
$emailTemplate = AO::getModel('core/email_template');
/* @var $emailTemplate Mage_Core_Model_Email_Template */
$emailTemplate->setDesignConfig(array('area' => 'backend'))->sendTransactional(AO::getStoreConfig(self::XML_PATH_ERROR_TEMPLATE), AO::getStoreConfig(self::XML_PATH_ERROR_IDENTITY), AO::getStoreConfig(self::XML_PATH_ERROR_RECIPIENT), null, array('warnings' => join("\n", $errors)));
$translate->setTranslateInline(true);
}
}
示例7: getCarrierName
public function getCarrierName($carrierCode)
{
if ($name = AO::getStoreConfig('carriers/' . $carrierCode . '/title')) {
return $name;
}
return $carrierCode;
}
示例8: _toHtml
protected function _toHtml()
{
$storeId = $this->_getStoreId();
$newurl = AO::getUrl('rss/catalog/new');
$title = AO::helper('rss')->__('New Products from %s', AO::app()->getStore()->getGroup()->getName());
$lang = AO::getStoreConfig('general/locale/code');
$rssObj = AO::getModel('rss/rss');
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8', 'language' => $lang);
$rssObj->_addHeader($data);
/*
oringinal price - getPrice() - inputed in admin
special price - getSpecialPrice()
getFinalPrice() - used in shopping cart calculations
*/
$product = AO::getModel('catalog/product');
$todayDate = $product->getResource()->formatDate(time());
$products = $product->getCollection()->setStoreId($storeId)->addStoreFilter()->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))->addAttributeToFilter(array(array('attribute' => 'news_to_date', 'date' => true, 'from' => $todayDate), array('attribute' => 'news_to_date', 'is' => new Zend_Db_Expr('null'))), '', 'left')->addAttributeToSort('news_from_date', 'desc')->addAttributeToSelect(array('name', 'short_description', 'description', 'price', 'thumbnail'), 'inner')->addAttributeToSelect(array('special_price', 'special_from_date', 'special_to_date'), 'left');
AO::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
AO::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
//echo $products->getSelect();
/*
using resource iterator to load the data one by one
instead of loading all at the same time. loading all data at the same time can cause the big memory allocation.
*/
AO::getSingleton('core/resource_iterator')->walk($products->getSelect(), array(array($this, 'addNewItemXmlCallback')), array('rssObj' => $rssObj, 'product' => $product));
return $rssObj->createRssXml();
}
示例9: getPageSize
/**
* Retrieve page size (count)
*
* @return int
*/
protected function getPageSize()
{
if ($this->hasData('page_size')) {
return $this->getData('page_size');
}
return AO::getStoreConfig(self::XML_PATH_RECENTLY_VIEWED_COUNT);
}
示例10: _toHtml
protected function _toHtml()
{
if (!$this->_beforeToHtml() || !AO::getStoreConfig('dev/debug/profiler') || !AO::helper('core')->isDevAllowed()) {
return '';
}
$timers = Varien_Profiler::getTimers();
#$out = '<div style="position:fixed;bottom:5px;right:5px;opacity:.1;background:white" onmouseover="this.style.opacity=1" onmouseout="this.style.opacity=.1">';
#$out = '<div style="opacity:.1" onmouseover="this.style.opacity=1" onmouseout="this.style.opacity=.1">';
$out = "<a href=\"javascript:void(0)\" onclick=\"\$('profiler_section').style.display=\$('profiler_section').style.display==''?'none':''\">[profiler]</a>";
$out .= '<div id="profiler_section" style="background:white; display:block">';
$out .= '<pre>Memory usage: real: ' . memory_get_usage(true) . ', emalloc: ' . memory_get_usage() . '</pre>';
$out .= '<table border="1" cellspacing="0" cellpadding="2" style="width:auto">';
$out .= '<tr><th>Code Profiler</th><th>Time</th><th>Cnt</th><th>Emalloc</th><th>RealMem</th></tr>';
foreach ($timers as $name => $timer) {
$sum = Varien_Profiler::fetch($name, 'sum');
$count = Varien_Profiler::fetch($name, 'count');
$realmem = Varien_Profiler::fetch($name, 'realmem');
$emalloc = Varien_Profiler::fetch($name, 'emalloc');
if ($sum < 0.001 && $count < 10 && $emalloc < 10000) {
continue;
}
$out .= '<tr>' . '<td align="left">' . $name . '</td>' . '<td>' . number_format($sum, 4) . '</td>' . '<td align="right">' . $count . '</td>' . '<td align="right">' . number_format($emalloc) . '</td>' . '<td align="right">' . number_format($realmem) . '</td>' . '</tr>';
}
$out .= '</table>';
$out .= '<pre>';
$out .= print_r(Varien_Profiler::getSqlProfiler(AO::getSingleton('core/resource')->getConnection('core_write')), 1);
$out .= '</pre>';
$out .= '</div>';
return $out;
}
示例11: isShow
public function isShow()
{
if (!AO::getStoreConfig('catalog/productalert/allow_price')) {
return false;
}
return true;
}
示例12: scheduledUpdateCurrencyRates
public function scheduledUpdateCurrencyRates($schedule)
{
$importWarnings = array();
if (!AO::getStoreConfig(self::IMPORT_ENABLE) || !AO::getStoreConfig(self::CRON_STRING_PATH)) {
return;
}
$service = AO::getStoreConfig(self::IMPORT_SERVICE);
if (!$service) {
$importWarnings[] = AO::helper('directory')->__('FATAL ERROR:') . ' ' . AO::helper('directory')->__('Invalid Import Service Specified');
}
try {
$importModel = AO::getModel(AO::getConfig()->getNode('global/currency/import/services/' . $service . '/model')->asArray());
} catch (Exception $e) {
$importWarnings[] = AO::helper('directory')->__('FATAL ERROR:') . ' ' . AO::throwException(AO::helper('directory')->__('Unable to initialize import model'));
}
$rates = $importModel->fetchRates();
$errors = $importModel->getMessages();
if (sizeof($errors) > 0) {
foreach ($errors as $error) {
$importWarnings[] = AO::helper('directory')->__('WARNING:') . ' ' . $error;
}
}
if (sizeof($importWarnings) == 0) {
AO::getModel('directory/currency')->saveRates($rates);
} else {
$translate = AO::getSingleton('core/translate');
/* @var $translate Mage_Core_Model_Translate */
$translate->setTranslateInline(false);
/* @var $mailTemplate Mage_Core_Model_Email_Template */
$mailTemplate = AO::getModel('core/email_template');
$mailTemplate->setDesignConfig(array('area' => 'frontend'))->sendTransactional(AO::getStoreConfig(self::XML_PATH_ERROR_TEMPLATE), AO::getStoreConfig(self::XML_PATH_ERROR_IDENTITY), AO::getStoreConfig(self::XML_PATH_ERROR_RECIPIENT), null, array('warnings' => join("\n", $importWarnings)));
$translate->setTranslateInline(true);
}
}
示例13: getLinksTitle
public function getLinksTitle()
{
if ($this->_purchased->getLinkSectionTitle()) {
return $this->_purchased->getLinkSectionTitle();
}
return AO::getStoreConfig(Mage_Downloadable_Model_Link::XML_PATH_LINKS_TITLE);
}
示例14: _toHtml
protected function _toHtml()
{
//store id is store view id
$storeId = $this->_getStoreId();
$websiteId = AO::app()->getStore($storeId)->getWebsiteId();
//customer group id
$custGroup = $this->_getCustomerGroupId();
$newurl = AO::getUrl('rss/catalog/salesrule');
$title = AO::helper('rss')->__('%s - Discounts and Coupons', AO::app()->getStore($storeId)->getName());
$lang = AO::getStoreConfig('general/locale/code');
$rssObj = AO::getModel('rss/rss');
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8', 'language' => $lang);
$rssObj->_addHeader($data);
$now = date('Y-m-d');
$_saleRule = AO::getModel('salesrule/rule');
$collection = $_saleRule->getResourceCollection()->addFieldToFilter('from_date', array('date' => true, 'to' => $now))->addFieldToFilter('website_ids', array('finset' => $websiteId))->addFieldToFilter('customer_group_ids', array('finset' => $custGroup))->addFieldToFilter('is_rss', 1)->addFieldToFilter('is_active', 1)->setOrder('from_date', 'desc');
$collection->getSelect()->where('to_date is null or to_date>=?', $now);
$collection->load();
$url = AO::getUrl('');
foreach ($collection as $sr) {
$description = '<table><tr>' . '<td style="text-decoration:none;">' . $sr->getDescription() . '<br/>Discount Start Date: ' . $this->formatDate($sr->getFromDate(), 'medium') . ($sr->getToDate() ? '<br/>Discount End Date: ' . $this->formatDate($sr->getToDate(), 'medium') : '') . ($sr->getCouponCode() ? '<br/> Coupon Code: ' . $sr->getCouponCode() . '' : '') . '</td>' . '</tr></table>';
$data = array('title' => $sr->getName(), 'description' => $description, 'link' => $url);
$rssObj->_addEntry($data);
}
return $rssObj->createRssXml();
}
示例15: _beforeToHtml
public function _beforeToHtml()
{
$this->_currency = AO::getModel('directory/currency')->load(AO::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE));
$this->_collection = AO::getResourceModel('sales/sale_collection')->setCustomerFilter(AO::registry('current_customer'))->load();
$this->_groupedCollection = array();
foreach ($this->_collection as $sale) {
if (!is_null($sale->getStoreId())) {
$store = AO::app()->getStore($sale->getStoreId());
$websiteId = $store->getWebsiteId();
$groupId = $store->getGroupId();
$storeId = $store->getId();
$sale->setWebsiteId($store->getWebsiteId());
$sale->setWebsiteName($store->getWebsite()->getName());
$sale->setGroupId($store->getGroupId());
$sale->setGroupName($store->getGroup()->getName());
} else {
$websiteId = 0;
$groupId = 0;
$storeId = 0;
$sale->setStoreName(AO::helper('customer')->__('Deleted Stores'));
}
$this->_groupedCollection[$websiteId][$groupId][$storeId] = $sale;
$this->_websiteCounts[$websiteId] = isset($this->_websiteCounts[$websiteId]) ? $this->_websiteCounts[$websiteId] + 1 : 1;
}
return parent::_beforeToHtml();
}