コード例 #1
0
ファイル: Catalog_New.php プロジェクト: ronseigel/agent-ohm
 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();
 }
コード例 #2
0
 /**
  * When a customer chooses iDEAL Advanced on Checkout/Payment page
  *
  */
 public function redirectAction()
 {
     $order = AO::getModel('sales/order');
     $order->load($this->getCheckout()->getLastOrderId());
     if ($order->getId()) {
         $advanced = $order->getPayment()->getMethodInstance();
         $issuerId = $order->getPayment()->getIdealIssuerId();
         $response = $advanced->sendTransactionRequest($order, $issuerId);
         if ($response) {
             $order->getPayment()->setTransactionId($response->getTransactionId());
             $order->getPayment()->setLastTransId($response->getTransactionId());
             $order->getPayment()->setIdealTransactionChecked(0);
             if ($response->getError()) {
                 $this->getCheckout()->setIdealErrorMessage($response->getError());
                 $this->_redirect('*/*/failure');
                 return;
             }
             $this->getResponse()->setBody($this->getLayout()->createBlock('ideal/advanced_redirect')->setMessage($this->__('You will be redirected to bank in a few seconds.'))->setRedirectUrl($response->getIssuerAuthenticationUrl())->toHtml());
             $order->addStatusToHistory($order->getStatus(), $this->__('Customer was redirected to iDEAL'));
             $order->save();
             $this->getCheckout()->setIdealAdvancedQuoteId($this->getCheckout()->getQuoteId(true));
             $this->getCheckout()->setIdealAdvancedOrderId($this->getCheckout()->getLastOrderId(true));
             return;
         }
     }
     $this->getResponse()->setBody($this->getLayout()->createBlock('ideal/advanced_redirect')->setMessage($this->__('Error occured. You will be redirected back to store.'))->setRedirectUrl(AO::getUrl('checkout/cart'))->toHtml());
 }
コード例 #3
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();
 }
コード例 #4
0
ファイル: Wishlist.php プロジェクト: ronseigel/agent-ohm
 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();
 }
コード例 #5
0
ファイル: Order_Status.php プロジェクト: ronseigel/agent-ohm
 protected function _toHtml()
 {
     $rssObj = AO::getModel('rss/rss');
     $order = AO::registry('current_order');
     $title = AO::helper('rss')->__('Order # %s Notification(s)', $order->getIncrementId());
     $newurl = AO::getUrl('sales/order/view', array('order_id' => $order->getId()));
     $data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8');
     $rssObj->_addHeader($data);
     $resourceModel = AO::getResourceModel('rss/order');
     $results = $resourceModel->getAllCommentCollection($order->getId());
     $entityTypes = $resourceModel->getEntityTypeIdsToTypes();
     $incrementIds = $resourceModel->getEntityIdsToIncrementIds();
     if ($results) {
         foreach ($results as $result) {
             $urlAppend = 'view';
             $type = $entityTypes[$result['entity_type_id']];
             if ($type && $type != 'order') {
                 $urlAppend = $type;
             }
             $title = AO::helper('rss')->__('Details for %s #%s', ucwords($type), $incrementIds[$result['parent_id']]);
             $description = '<p>' . AO::helper('rss')->__('Notified Date: %s<br/>', $this->formatDate($result['created_at'])) . AO::helper('rss')->__('Comment: %s<br/>', $result['comment']) . '</p>';
             $url = AO::getUrl('sales/order/' . $urlAppend, array('order_id' => $order->getId()));
             $data = array('title' => $title, 'link' => $url, 'description' => $description);
             $rssObj->_addEntry($data);
         }
     }
     $title = AO::helper('rss')->__('Order #%s created at %s', $order->getIncrementId(), $this->formatDate($order->getCreatedAt()));
     $url = AO::getUrl('sales/order/view', array('order_id' => $order->getId()));
     $description = '<p>' . AO::helper('rss')->__('Current Status: %s<br/>', $order->getStatusLabel()) . AO::helper('rss')->__('Total: %s<br/>', $order->formatPrice($order->getGrandTotal())) . '</p>';
     $data = array('title' => $title, 'link' => $url, 'description' => $description);
     $rssObj->_addEntry($data);
     return $rssObj->createRssXml();
 }
コード例 #6
0
 public function indexAction()
 {
     $this->loadLayout();
     $this->getLayout()->getBlock('contactForm')->setFormAction(AO::getUrl('*/*/post'));
     $this->_initLayoutMessages('customer/session');
     $this->_initLayoutMessages('catalog/session');
     $this->renderLayout();
 }
コード例 #7
0
ファイル: Admin.php プロジェクト: ronseigel/agent-ohm
 /**
  * checking if we installed or not and doing redirect
  *
  * @return bool
  */
 protected function _afterModuleMatch()
 {
     if (!AO::isInstalled()) {
         AO::app()->getFrontController()->getResponse()->setRedirect(AO::getUrl('install'))->sendResponse();
         exit;
     }
     return true;
 }
コード例 #8
0
ファイル: Action.php プロジェクト: ronseigel/agent-ohm
 /**
  * Postdispatch: should set last visited url
  *
  * @return Mage_Core_Controller_Front_Action
  */
 public function postDispatch()
 {
     parent::postDispatch();
     if (!$this->getFlag('', self::FLAG_NO_START_SESSION)) {
         AO::getSingleton('core/session')->setLastUrl(AO::getUrl('*/*/*'), array('_current' => true));
     }
     return $this;
 }
コード例 #9
0
ファイル: List.php プロジェクト: ronseigel/agent-ohm
 /**
  * Add new rss feed
  *
  * @param   string $url
  * @param   string $label
  * @return  Mage_Core_Helper_Abstract
  */
 public function addRssFeed($url, $label, $param = array(), $customerGroup = false)
 {
     $param = array_merge($param, array('sid' => $this->getCurrentStoreId()));
     if ($customerGroup) {
         $param = array_merge($param, array('cid' => $this->getCurrentCustomerGroupId()));
     }
     $this->_rssFeeds[] = new Varien_Object(array('url' => AO::getUrl($url, $param), 'label' => $label));
     return $this;
 }
コード例 #10
0
 /**
  * Get url for remove item from filter
  *
  * @return string
  */
 public function getRemoveUrl()
 {
     $query = array($this->getFilter()->getRequestVar() => $this->getFilter()->getResetValue());
     $params = $query;
     $params['_current'] = true;
     $params['_use_rewrite'] = true;
     $params['_query'] = $query;
     return AO::getUrl('*/*/*', $params);
 }
コード例 #11
0
 public function indexAction()
 {
     $url = AO::getBaseUrl('web') . 'downloader/?return=' . urlencode(AO::getUrl('adminhtml'));
     $this->getResponse()->setRedirect($url);
     return;
     $this->loadLayout();
     $this->_setActiveMenu('system/extensions/local');
     $this->_addContent($this->getLayout()->createBlock('adminhtml/extensions_local'));
     $this->renderLayout();
 }
コード例 #12
0
ファイル: Catalog.php プロジェクト: ronseigel/agent-ohm
 public function getTagFeedUrl()
 {
     $url = '';
     if (AO::getStoreConfig('rss/catalog/tag') && $this->_getRequest()->getParam('tagId')) {
         $tagModel = AO::getModel('tag/tag')->load($this->_getRequest()->getParam('tagId'));
         if ($tagModel && $tagModel->getId()) {
             return AO::getUrl('rss/catalog/tag', array('tagName' => $tagModel->getName()));
         }
     }
     return $url;
 }
コード例 #13
0
 public function addReviewItemXmlCallback($args)
 {
     $rssObj = $args['rssObj'];
     $reviewModel = $args['reviewModel'];
     $row = $args['row'];
     $productUrl = AO::getUrl('catalog/product/view', array('id' => $row['entity_id']));
     $reviewUrl = AO::helper('adminhtml')->getUrl('adminhtml/catalog_product_review/edit/', array('id' => $row['review_id'], '_secure' => true, '_nosecret' => true));
     $storeName = AO::app()->getStore($row['store_id'])->getName();
     $description = '<p>' . $this->__('Product: <a href="%s">%s</a> <br/>', $productUrl, $row['name']) . $this->__('Summary of review: %s <br/>', $row['title']) . $this->__('Review: %s <br/>', $row['detail']) . $this->__('Store: %s <br/>', $storeName) . $this->__('click <a href="%s">here</a> to view the review', $reviewUrl) . '</p>';
     $data = array('title' => $this->__('Product: "%s" review By: %s', $row['name'], $row['nickname']), 'link' => 'test', 'description' => $description);
     $rssObj->_addEntry($data);
 }
コード例 #14
0
ファイル: Cart.php プロジェクト: ronseigel/agent-ohm
 public function getContinueShoppingUrl()
 {
     $url = $this->getData('continue_shopping_url');
     if (is_null($url)) {
         $url = AO::getSingleton('checkout/session')->getContinueShoppingUrl(true);
         if (!$url) {
             $url = AO::getUrl();
         }
         $this->setData('continue_shopping_url', $url);
     }
     return $url;
 }
コード例 #15
0
ファイル: Layer_State.php プロジェクト: ronseigel/agent-ohm
 /**
  * Retrieve Clear Filters URL
  *
  * @return string
  */
 public function getClearUrl()
 {
     $filterState = array();
     foreach ($this->getActiveFilters() as $item) {
         $filterState[$item->getFilter()->getRequestVar()] = $item->getFilter()->getResetValue();
     }
     $params = $filterState;
     $params['_current'] = true;
     $params['_use_rewrite'] = true;
     $params['_query'] = $filterState;
     return AO::getUrl('*/*/*', $params);
 }
コード例 #16
0
 /**
  * Processing file data
  *
  * @param string $text
  * @return string
  */
 public function processFileData($text)
 {
     $template = AO::getModel('core/email_template_filter');
     if (null === $this->_wsdlVariables) {
         $this->_wsdlVariables = new Varien_Object();
         $this->_wsdlVariables->setUrl(AO::getUrl('*/*/*'));
         $this->_wsdlVariables->setName('Magento');
         $this->_wsdlVariables->setHandler($this->getHandler());
     }
     $template->setVariables(array('wsdl' => $this->_wsdlVariables));
     $text = $template->filter($text);
     return $text;
 }
コード例 #17
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();
     $product = AO::getModel('catalog/product');
     $todayDate = $product->getResource()->formatDate(time());
     $rulePriceWhere = "({{table}}.rule_date is null) or ({{table}}.rule_date='{$todayDate}' and {{table}}.website_id='{$websiteId}' and {{table}}.customer_group_id='{$custGroup}')";
     $specials = $product->setStoreId($storeId)->getResourceCollection()->addAttributeToFilter('special_price', array('gt' => 0), 'left')->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate), 'left')->addAttributeToFilter(array(array('attribute' => 'special_to_date', 'date' => true, 'from' => $todayDate), array('attribute' => 'special_to_date', 'is' => new Zend_Db_Expr('null'))), '', 'left')->addAttributeToSort('special_from_date', 'desc')->addAttributeToSelect(array('name', 'short_description', 'description', 'price', 'thumbnail'), 'inner')->joinTable('catalogrule/rule_product_price', 'product_id=entity_id', array('rule_price' => 'rule_price', 'rule_start_date' => 'latest_start_date'), $rulePriceWhere, 'left');
     //public function join($table, $cond, $cols='*')
     $rulePriceCollection = AO::getResourceModel('catalogrule/rule_product_price_collection')->addFieldToFilter('website_id', $websiteId)->addFieldToFilter('customer_group_id', $custGroup)->addFieldToFilter('rule_date', $todayDate);
     //echo $rulePriceCollection->getSelect();
     $productIds = $rulePriceCollection->getProductIds();
     if (!empty($productIds)) {
         $specials->getSelect()->orWhere('e.entity_id in (' . implode(',', $productIds) . ')');
     }
     /*
      *need to put status and visibility after orWhere clause for catalog price rule products
      */
     AO::getSingleton('catalog/product_status')->addVisibleFilterToCollection($specials);
     AO::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($specials);
     //echo $specials->getSelect();
     $newurl = AO::getUrl('rss/catalog/new');
     $title = AO::helper('rss')->__('%s - Special Discounts', AO::app()->getStore()->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);
     $results = array();
     /*
     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($specials->getSelect(), array(array($this, 'addSpecialXmlCallback')), array('rssObj' => $rssObj, 'results' => &$results));
     if (sizeof($results) > 0) {
         usort($results, array(&$this, 'sortByStartDate'));
         foreach ($results as $result) {
             $product->setData($result);
             //$product->unsetData()->load($result['entity_id']);
             $special_price = $result['use_special'] ? $result['special_price'] : $result['rule_price'];
             $description = '<table><tr>' . '<td><a href="' . $product->getProductUrl() . '"><img src="' . $this->helper('catalog/image')->init($product, '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()) . ' Special Price:' . AO::helper('core')->currency($special_price) . ($result['use_special'] && $result['special_to_date'] ? '<br/> Special Expires on: ' . $this->formatDate($result['special_to_date'], Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM) : '') . '</p>' . '</td>' . '</tr></table>';
             $data = array('title' => $product->getName(), 'link' => $product->getProductUrl(), 'description' => $description);
             $rssObj->_addEntry($data);
         }
     }
     return $rssObj->createRssXml();
 }
コード例 #18
0
ファイル: Catalog_Tag.php プロジェクト: ronseigel/agent-ohm
 protected function _toHtml()
 {
     //store id is store view id
     $storeId = $this->_getStoreId();
     $tagModel = AO::registry('tag_model');
     $newurl = AO::getUrl('rss/catalog/new');
     $title = AO::helper('rss')->__('Products tagged with %s', $tagModel->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);
     $_collection = $tagModel->getEntityCollection()->addTagFilter($tagModel->getId())->addStoreFilter($storeId);
     $product = AO::getModel('catalog/product');
     AO::getSingleton('core/resource_iterator')->walk($_collection->getSelect(), array(array($this, 'addTaggedItemXml')), array('rssObj' => $rssObj, 'product' => $product));
     return $rssObj->createRssXml();
 }
コード例 #19
0
ファイル: Router.php プロジェクト: ronseigel/agent-ohm
 public function match(Zend_Controller_Request_Http $request)
 {
     if (!AO::isInstalled()) {
         AO::app()->getFrontController()->getResponse()->setRedirect(AO::getUrl('install'))->sendResponse();
         exit;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $page = AO::getModel('cms/page');
     $pageId = $page->checkIdentifier($identifier, AO::app()->getStore()->getId());
     if (!$pageId) {
         return false;
     }
     $request->setModuleName(isset($d[0]) ? $d[0] : 'cms')->setControllerName(isset($d[1]) ? $d[1] : 'page')->setActionName(isset($d[2]) ? $d[2] : 'view')->setParam('page_id', $pageId);
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return true;
 }
コード例 #20
0
 public function preDispatch()
 {
     parent::preDispatch();
     $allowGuest = AO::helper('review')->getIsGuestAllowToWrite();
     if (!$this->getRequest()->isDispatched()) {
         return;
     }
     $action = $this->getRequest()->getActionName();
     if (!$allowGuest && $action == 'post' && $this->getRequest()->isPost()) {
         if (!AO::getSingleton('customer/session')->isLoggedIn()) {
             $this->setFlag('', self::FLAG_NO_DISPATCH, true);
             AO::getSingleton('customer/session')->setBeforeAuthUrl(AO::getUrl('*/*/*', array('_current' => true)));
             AO::getSingleton('review/session')->setFormData($this->getRequest()->getPost())->setRedirectUrl($this->_getRefererUrl());
             $this->_redirectUrl(AO::helper('customer')->getLoginUrl());
         }
     }
     return $this;
 }
コード例 #21
0
 protected function _toHtml()
 {
     $newurl = AO::getUrl('rss/catalog/notifystock');
     $title = AO::helper('rss')->__('Low Stock Products');
     $rssObj = AO::getModel('rss/rss');
     $data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8');
     $rssObj->_addHeader($data);
     $_configManageStock = (int) AO::getStoreConfigFlag(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK);
     $stockItemWhere = "({{table}}.low_stock_date is not null) " . " and ({{table}}.low_stock_date>'0000-00-00') " . " and IF({{table}}.use_config_manage_stock=1," . $_configManageStock . ",{{table}}.manage_stock)=1";
     $product = AO::getModel('catalog/product');
     $collection = $product->getCollection()->addAttributeToSelect('name', true)->addAttributeToSelect('name', true)->joinTable('cataloginventory/stock_item', 'product_id=entity_id', array('qty' => 'qty', 'notify_stock_qty' => 'notify_stock_qty', 'use_config' => 'use_config_notify_stock_qty', 'low_stock_date' => 'low_stock_date'), $stockItemWhere, 'inner')->setOrder('low_stock_date');
     $_globalNotifyStockQty = (double) AO::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY);
     /*
     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($collection->getSelect(), array(array($this, 'addNotifyItemXmlCallback')), array('rssObj' => $rssObj, 'product' => $product, 'globalQty' => $_globalNotifyStockQty));
     return $rssObj->createRssXml();
 }
コード例 #22
0
ファイル: Api_Advanced.php プロジェクト: ronseigel/agent-ohm
 public function __construct()
 {
     $this->_http = new Varien_Http_Adapter_Curl();
     $this->_security = new Mage_Ideal_Model_Api_Advanced_Security();
     if ($this->getConfigData('test_flag') == 1) {
         $acquirerUrl = 'https://idealtest.secure-ing.com/ideal/iDeal';
     } else {
         $acquirerUrl = 'https://ideal.secure-ing.com/ideal/iDeal';
     }
     if (!($description = $this->getConfigData('description'))) {
         $description = AO::app()->getStore()->getName() . ' payment';
     }
     $this->_conf = array('PRIVATEKEY' => $this->getConfigData('private_key'), 'PRIVATEKEYPASS' => $this->getConfigData('private_keypass'), 'PRIVATECERT' => $this->getConfigData('private_cert'), 'AUTHENTICATIONTYPE' => 'SHA1_RSA', 'CERTIFICATE0' => $this->getConfigData('certificate'), 'ACQUIRERURL' => $acquirerUrl, 'ACQUIRERTIMEOUT' => '10', 'MERCHANTID' => $this->getConfigData('merchant_id'), 'SUBID' => '0', 'MERCHANTRETURNURL' => AO::getUrl('ideal/advanced/result', array('_secure' => true)), 'CURRENCY' => 'EUR', 'EXPIRATIONPERIOD' => 'PT10M', 'LANGUAGE' => 'nl', 'DESCRIPTION' => $description, 'ENTRANCECODE' => '');
     if ((int) $this->getConfigData('expire_period') >= 1 && $this->getConfigData('expire_period') < 60) {
         $this->_conf['EXPIRATIONPERIOD'] = 'PT' . $this->getConfigData('expire_period') . 'M';
     } else {
         if ($this->getConfigData('description') == 60) {
             $this->_conf['EXPIRATIONPERIOD'] = 'PT1H';
         }
     }
 }
コード例 #23
0
ファイル: ActivePoll.php プロジェクト: ronseigel/agent-ohm
 public function __construct()
 {
     parent::__construct();
     $pollModel = AO::getModel('poll/poll');
     // get last voted poll (from session only)
     $pollId = AO::getSingleton('core/session')->getJustVotedPoll();
     if (empty($pollId)) {
         // get random not voted yet poll
         $votedIds = $pollModel->getVotedPollsIds();
         $pollId = $pollModel->setExcludeFilter($votedIds)->setStoreFilter(AO::app()->getStore()->getId())->getRandomId();
     }
     if (empty($pollId)) {
         return false;
     }
     $poll = $pollModel->load($pollId);
     $pollAnswers = AO::getModel('poll/poll_answer')->getResourceCollection()->addPollFilter($pollId)->load()->countPercent($poll);
     // correct rounded percents to be always equal 100
     $percentsSorted = array();
     $answersArr = array();
     foreach ($pollAnswers as $key => $answer) {
         $percentsSorted[$key] = $answer->getPercent();
         $answersArr[$key] = $answer;
     }
     asort($percentsSorted);
     $total = 0;
     foreach ($percentsSorted as $key => $value) {
         $total += $value;
     }
     // change the max value only
     if ($total > 0 && $total !== 100) {
         $answersArr[$key]->setPercent($value + 100 - $total);
     }
     $this->assign('poll', $poll)->assign('poll_answers', $pollAnswers)->assign('action', AO::getUrl('poll/vote/add', array('poll_id' => $pollId)));
     $this->_voted = AO::getModel('poll/poll')->isVoted($pollId);
     AO::getSingleton('core/session')->setJustVotedPoll(false);
 }
コード例 #24
0
ファイル: View.php プロジェクト: ronseigel/agent-ohm
 public function getBackUrl()
 {
     return AO::getUrl('*/*/list', array('id' => $this->getProductData()->getId()));
 }
コード例 #25
0
ファイル: Onepage_Login.php プロジェクト: ronseigel/agent-ohm
 public function getPostAction()
 {
     return AO::getUrl('customer/account/loginPost', array('_secure' => true));
 }
コード例 #26
0
 public function getBackUrl()
 {
     return AO::getUrl('*/cart/');
 }
コード例 #27
0
 public function getPrintUrl()
 {
     return AO::getUrl('*/*/print');
 }
コード例 #28
0
 public function getWishlistAddToCartLink($wishlistItem)
 {
     return AO::getUrl('wishlist/index/cart', array('item' => $wishlistItem->getId()));
 }
コード例 #29
0
ファイル: Express.php プロジェクト: ronseigel/agent-ohm
 /**
  * Making API call to check transaction's status when customer returns from paypal
  *
  * @return Mage_Paypal_Model_Express
  */
 public function returnFromPaypal()
 {
     $error = '';
     try {
         $this->_getExpressCheckoutDetails();
     } catch (Exception $e) {
         $error = $e->getMessage();
         $this->getSession()->addError($e->getMessage());
         $this->getApi()->setRedirectUrl('paypal/express/review');
     }
     switch ($this->getApi()->getUserAction()) {
         case Mage_Paypal_Model_Api_Nvp::USER_ACTION_CONTINUE:
             $this->getApi()->setRedirectUrl(AO::getUrl('paypal/express/review'));
             break;
         case Mage_Paypal_Model_Api_Nvp::USER_ACTION_COMMIT:
             if ($this->getSession()->getExpressCheckoutMethod() == 'shortcut') {
                 $this->getApi()->setRedirectUrl(AO::getUrl('paypal/express/saveOrder'));
             } else {
                 $this->getApi()->setRedirectUrl(AO::getUrl('paypal/express/updateOrder'));
             }
             break;
     }
     return $this;
 }
コード例 #30
0
ファイル: Tag.php プロジェクト: ronseigel/agent-ohm
 public function getRemoveTagUrl()
 {
     return AO::getUrl('tag/customer/remove', array('tagId' => $this->getTagId()));
 }