Пример #1
0
 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
0
 public function getCopyright()
 {
     if (!$this->_copyright) {
         $this->_copyright = AO::getStoreConfig('design/footer/copyright');
     }
     return $this->_copyright;
 }
Пример #3
0
 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
0
 public function isStatusNotificationAllow()
 {
     if (AO::getStoreConfig('rss/order/status_notified')) {
         return true;
     }
     return false;
 }
Пример #5
0
 public function isAllow()
 {
     if (AO::getStoreConfig('sales/reorder/allow')) {
         return true;
     }
     return false;
 }
Пример #6
0
 /**
  * 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
0
 public function getCarrierName($carrierCode)
 {
     if ($name = AO::getStoreConfig('carriers/' . $carrierCode . '/title')) {
         return $name;
     }
     return $carrierCode;
 }
Пример #8
0
 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
0
 /**
  * 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
0
 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
0
 public function isShow()
 {
     if (!AO::getStoreConfig('catalog/productalert/allow_price')) {
         return false;
     }
     return true;
 }
Пример #12
0
 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);
     }
 }
 public function getLinksTitle()
 {
     if ($this->_purchased->getLinkSectionTitle()) {
         return $this->_purchased->getLinkSectionTitle();
     }
     return AO::getStoreConfig(Mage_Downloadable_Model_Link::XML_PATH_LINKS_TITLE);
 }
Пример #14
0
 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();
 }
 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();
 }
 /**
  * Return title of samples section
  *
  * @return string
  */
 public function getSamplesTitle()
 {
     if ($this->getProduct()->getSamplesTitle()) {
         return $this->getProduct()->getSamplesTitle();
     }
     return AO::getStoreConfig(Mage_Downloadable_Model_Sample::XML_PATH_SAMPLES_TITLE);
 }
Пример #17
0
 /**
  * Get url of eWAY 3D-Secure Payment
  *
  * @return string
  */
 public function getEwaySecureUrl()
 {
     if (!($url = AO::getStoreConfig('payment/' . $this->getCode() . '/api_url'))) {
         $url = 'https://www.eway.com.au/gateway_3d/payment.asp';
     }
     return $url;
 }
Пример #18
0
 public function getConfig($key, $store = null)
 {
     if (is_null($this->_config)) {
         $this->_config = AO::getStoreConfig('customer/address');
     }
     return isset($this->_config[$key]) ? $this->_config[$key] : null;
 }
 protected function _prepareLayout()
 {
     $product = $this->getProduct();
     if (!($setId = $product->getAttributeSetId())) {
         $setId = $this->getRequest()->getParam('set', null);
     }
     if ($setId) {
         $groupCollection = AO::getResourceModel('eav/entity_attribute_group_collection')->setAttributeSetFilter($setId)->load();
         foreach ($groupCollection as $group) {
             $attributes = $product->getAttributes($group->getId(), true);
             // do not add grops without attributes
             foreach ($attributes as $key => $attribute) {
                 if (!$attribute->getIsVisible()) {
                     unset($attributes[$key]);
                 }
             }
             if (count($attributes) == 0) {
                 continue;
             }
             $this->addTab('group_' . $group->getId(), array('label' => AO::helper('catalog')->__($group->getAttributeGroupName()), 'content' => $this->getLayout()->createBlock($this->getAttributeTabBlock())->setGroup($group)->setGroupAttributes($attributes)->toHtml()));
         }
         $this->addTab('inventory', array('label' => AO::helper('catalog')->__('Inventory'), 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_inventory')->toHtml()));
         /**
          * Don't display website tab for single mode
          */
         if (!AO::app()->isSingleStoreMode() && $this->_enabledWebsites()) {
             $this->addTab('websites', array('label' => AO::helper('catalog')->__('Websites'), 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_websites')->toHtml()));
         }
         $this->addTab('categories', array('label' => AO::helper('catalog')->__('Categories'), 'url' => $this->getUrl('*/*/categories', array('_current' => true)), 'class' => 'ajax'));
         $this->addTab('related', array('label' => AO::helper('catalog')->__('Related Products'), 'url' => $this->getUrl('*/*/related', array('_current' => true)), 'class' => 'ajax'));
         $this->addTab('upsell', array('label' => AO::helper('catalog')->__('Up-sells'), 'url' => $this->getUrl('*/*/upsell', array('_current' => true)), 'class' => 'ajax'));
         $this->addTab('crosssell', array('label' => AO::helper('catalog')->__('Cross-sells'), 'url' => $this->getUrl('*/*/crosssell', array('_current' => true)), 'class' => 'ajax'));
         $storeId = 0;
         if ($this->getRequest()->getParam('store')) {
             $storeId = AO::app()->getStore($this->getRequest()->getParam('store'))->getId();
         }
         $alertPriceAllow = AO::getStoreConfig('catalog/productalert/allow_price');
         $alertStockAllow = AO::getStoreConfig('catalog/productalert/allow_stock');
         if ($alertPriceAllow || $alertStockAllow) {
             $this->addTab('productalert', array('label' => AO::helper('catalog')->__('Product Alerts'), 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts', 'admin.alerts.products')->toHtml()));
         }
         if ($this->getRequest()->getParam('id', false)) {
             $this->addTab('reviews', array('label' => AO::helper('catalog')->__('Product Reviews'), 'url' => $this->getUrl('*/*/reviews', array('_current' => true)), 'class' => 'ajax'));
             $this->addTab('tags', array('label' => AO::helper('catalog')->__('Product Tags'), 'url' => $this->getUrl('*/*/tagGrid', array('_current' => true)), 'class' => 'ajax'));
             $this->addTab('customers_tags', array('label' => AO::helper('catalog')->__('Customers Tagged Product'), 'url' => $this->getUrl('*/*/tagCustomerGrid', array('_current' => true)), 'class' => 'ajax'));
         }
         /**
          * Do not change this tab id
          * @see Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable
          * @see Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tabs
          */
         if ($this->getProduct()->getTypeId() != Mage_Catalog_Model_Product_Type::TYPE_GROUPED) {
             $this->addTab('customer_options', array('label' => AO::helper('catalog')->__('Custom Options'), 'url' => $this->getUrl('*/*/options', array('_current' => true)), 'class' => 'ajax'));
         }
     } else {
         $this->addTab('set', array('label' => AO::helper('catalog')->__('Settings'), 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_settings')->toHtml(), 'active' => true));
     }
     return parent::_prepareLayout();
 }
Пример #20
0
 /**
  * Retrieve information from carrier configuration
  *
  * @param   string $field
  * @return  mixed
  */
 public function getConfigData($field)
 {
     if (empty($this->_code)) {
         return false;
     }
     $path = 'carriers/' . $this->_code . '/' . $field;
     return AO::getStoreConfig($path, $this->getStore());
 }
 /**
  * Get product thumbnail image
  *
  * @return Mage_Catalog_Model_Product_Image
  */
 public function getProductThumbnail()
 {
     $product = $this->getProduct();
     if (!$product->getData('thumbnail') || $product->getData('thumbnail') == 'no_selection' || AO::getStoreConfig(self::GROUPED_PRODUCT_IMAGE) == self::USE_PARENT_IMAGE) {
         $product = $this->getGroupedProduct();
     }
     return $this->helper('catalog/image')->init($product, 'thumbnail');
 }
Пример #22
0
 /**
  *  Return config var
  *
  *  @param    string $key Var path key
  *  @param    int $storeId Store View Id
  *  @return	  mixed
  */
 public function getConfigData($key, $storeId = null)
 {
     if (!$this->hasData($key)) {
         $value = AO::getStoreConfig('google/googlebase/' . $key, $storeId);
         $this->setData($key, $value);
     }
     return $this->getData($key);
 }
Пример #23
0
 /**
  * Retrieve carrier model instance by carrier code
  *
  * @param   string $carrierCode
  * @param   mixed $store
  * @return  Mage_Usa_Model_Shipping_Carrier_Abstract
  */
 public function getCarrierInstance($carrierCode, $store = null)
 {
     $carrierConfig = AO::getStoreConfig('carriers/' . $carrierCode, $store);
     if (!empty($carrierConfig)) {
         return $this->_getCarrier($carrierCode, $carrierConfig, $store);
     }
     return false;
 }
Пример #24
0
 public function isWishlistActive()
 {
     $isActive = $this->_getData('is_wishlist_active');
     if ($isActive === null) {
         $isActive = AO::getStoreConfig('wishlist/general/active') && AO::getSingleton('customer/session')->isLoggedIn();
         $this->setIsWishlistActive($isActive);
     }
     return $isActive;
 }
Пример #25
0
 /**
  * Retrieve all system payments
  *
  * @param mixed $store
  * @return array
  */
 public function getAllMethods($store = null)
 {
     $methods = array();
     $config = AO::getStoreConfig('payment', $store);
     foreach ($config as $code => $methodConfig) {
         $methods[$code] = $this->_getMethod($code, $methodConfig);
     }
     return $methods;
 }
Пример #26
0
 public function isFreeMethod($method, $storeId = null)
 {
     $arr = explode('_', $method, 2);
     if (!isset($arr[1])) {
         return false;
     }
     $freeMethod = AO::getStoreConfig('carriers/' . $arr[0] . '/free_method', $storeId);
     return $freeMethod == $arr[1];
 }
Пример #27
0
 public function noRouteAction($coreRoute = null)
 {
     $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');
     $this->getResponse()->setHeader('Status', '404 File not found');
     $pageId = AO::getStoreConfig('web/default/cms_no_route');
     if (!AO::helper('cms/page')->renderPage($this, $pageId)) {
         $this->_forward('defaultNoRoute');
     }
 }
Пример #28
0
 public function preDispatch()
 {
     parent::preDispatch();
     if (!AO::getStoreConfig('catalog/seo/search_terms')) {
         $this->_redirect('noroute');
         $this->setFlag('', self::FLAG_NO_DISPATCH, true);
     }
     return $this;
 }
 public function loadByStore()
 {
     $allowCountries = explode(',', (string) AO::getStoreConfig('general/country/allow'));
     if (!empty($allowCountries)) {
         $this->addFieldToFilter("country.country_id", array('in' => $allowCountries));
     }
     $this->load();
     return $this;
 }
 public function toOptionArray()
 {
     $methods = array(array('value' => '', 'label' => ''));
     foreach ($this->_getPaymentMethods() as $paymentCode => $paymentModel) {
         $paymentTitle = AO::getStoreConfig('payment/' . $paymentCode . '/title');
         $methods[$paymentCode] = array('label' => $paymentTitle, 'value' => $paymentCode);
     }
     return $methods;
 }