Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup
  • Mage_CatalogInventory_Block_Adminhtml_Form_Field_Minsaleqty
  • Mage_CatalogInventory_Block_Qtyincrements
  • Mage_CatalogInventory_Block_Stockqty_Abstract
  • Mage_CatalogInventory_Block_Stockqty_Composite
  • Mage_CatalogInventory_Block_Stockqty_Default
  • Mage_CatalogInventory_Block_Stockqty_Type_Configurable
  • Mage_CatalogInventory_Block_Stockqty_Type_Grouped
  • Mage_CatalogInventory_Helper_Data
  • Mage_CatalogInventory_Helper_Minsaleqty
  • Mage_CatalogInventory_Model_Api2_Stock_Item
  • Mage_CatalogInventory_Model_Api2_Stock_Item_Rest
  • Mage_CatalogInventory_Model_Api2_Stock_Item_Rest_Admin_V1
  • Mage_CatalogInventory_Model_Api2_Stock_Item_Validator_Item
  • Mage_CatalogInventory_Model_Indexer_Stock
  • Mage_CatalogInventory_Model_Mysql4_Indexer_Stock
  • Mage_CatalogInventory_Model_Mysql4_Indexer_Stock_Configurable
  • Mage_CatalogInventory_Model_Mysql4_Indexer_Stock_Default
  • Mage_CatalogInventory_Model_Mysql4_Indexer_Stock_Grouped
  • Mage_CatalogInventory_Model_Mysql4_Stock
  • Mage_CatalogInventory_Model_Mysql4_Stock_Item
  • Mage_CatalogInventory_Model_Mysql4_Stock_Item_Collection
  • Mage_CatalogInventory_Model_Mysql4_Stock_Status
  • Mage_CatalogInventory_Model_Observer
  • Mage_CatalogInventory_Model_Resource_Indexer_Stock
  • Mage_CatalogInventory_Model_Resource_Indexer_Stock_Configurable
  • Mage_CatalogInventory_Model_Resource_Indexer_Stock_Default
  • Mage_CatalogInventory_Model_Resource_Indexer_Stock_Grouped
  • Mage_CatalogInventory_Model_Resource_Stock
  • Mage_CatalogInventory_Model_Resource_Stock_Item
  • Mage_CatalogInventory_Model_Resource_Stock_Item_Collection
  • Mage_CatalogInventory_Model_Resource_Stock_Status
  • Mage_CatalogInventory_Model_Source_Backorders
  • Mage_CatalogInventory_Model_Source_Stock
  • Mage_CatalogInventory_Model_Stock
  • Mage_CatalogInventory_Model_Stock_Item
  • Mage_CatalogInventory_Model_Stock_Item_Api
  • Mage_CatalogInventory_Model_Stock_Item_Api_V2
  • Mage_CatalogInventory_Model_Stock_Status
  • Mage_CatalogInventory_Model_System_Config_Backend_Minqty
  • Mage_CatalogInventory_Model_System_Config_Backend_Minsaleqty
  • Mage_CatalogInventory_Model_System_Config_Backend_Qtyincrements

Interfaces

  • Mage_CatalogInventory_Model_Mysql4_Indexer_Stock_Interface
  • Mage_CatalogInventory_Model_Resource_Indexer_Stock_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_CatalogInventory
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Catalo
 29:  */
 30: class Mage_CatalogInventory_Helper_Data extends Mage_Core_Helper_Abstract
 31: {
 32:     const XML_PATH_SHOW_OUT_OF_STOCK    = 'cataloginventory/options/show_out_of_stock';
 33:     const XML_PATH_ITEM_AUTO_RETURN     = 'cataloginventory/item_options/auto_return';
 34: 
 35:     /**
 36:      * Error codes, that Catalog Inventory module can set to quote or quote items
 37:      */
 38:     const ERROR_QTY =               1;
 39:     const ERROR_QTY_INCREMENTS =    2;
 40: 
 41:     /**
 42:      * All product types registry in scope of quantity availability
 43:      *
 44:      * @var array
 45:      */
 46:     protected static $_isQtyTypeIds;
 47: 
 48:     /**
 49:      * Check if quantity defined for specified product type
 50:      *
 51:      * @param string $productTypeId
 52:      * @return bool
 53:      */
 54:     public function isQty($productTypeId)
 55:     {
 56:         $this->getIsQtyTypeIds();
 57:         if (!isset(self::$_isQtyTypeIds[$productTypeId])) {
 58:             return false;
 59:         }
 60:         return self::$_isQtyTypeIds[$productTypeId];
 61:     }
 62: 
 63:     /**
 64:      * Get all registered product type ids and if quantity is defined for them
 65:      *
 66:      * @param bool $filter
 67:      * @return array
 68:      */
 69:     public function getIsQtyTypeIds($filter = null)
 70:     {
 71:         if (null === self::$_isQtyTypeIds) {
 72:             self::$_isQtyTypeIds = array();
 73:             $productTypesXml = Mage::getConfig()->getNode('global/catalog/product/type');
 74:             foreach ($productTypesXml->children() as $typeId => $configXml) {
 75:                 self::$_isQtyTypeIds[$typeId] = (bool)$configXml->is_qty;
 76:             }
 77:         }
 78:         if (null === $filter) {
 79:             return self::$_isQtyTypeIds;
 80:         }
 81:         $result = self::$_isQtyTypeIds;
 82:         foreach ($result as $key => $value) {
 83:             if ($value !== $filter) {
 84:                 unset($result[$key]);
 85:             }
 86:         }
 87:         return $result;
 88:     }
 89: 
 90:     /**
 91:      * Retrieve inventory item options (used in config)
 92:      *
 93:      * @return array
 94:      */
 95:     public function getConfigItemOptions()
 96:     {
 97:         return array(
 98:             'min_qty',
 99:             'backorders',
100:             'min_sale_qty',
101:             'max_sale_qty',
102:             'notify_stock_qty',
103:             'manage_stock',
104:             'enable_qty_increments',
105:             'qty_increments',
106:             'is_decimal_divided',
107:         );
108:     }
109: 
110:     /**
111:      * Display out of stock products option
112:      *
113:      * @return bool
114:      */
115:     public function isShowOutOfStock()
116:     {
117:         return Mage::getStoreConfigFlag(self::XML_PATH_SHOW_OUT_OF_STOCK);
118:     }
119: 
120:     /**
121:      * Check if creditmemo items auto return option is enabled
122:      * @return bool
123:      */
124:     public function isAutoReturnEnabled()
125:     {
126:         return Mage::getStoreConfigFlag(self::XML_PATH_ITEM_AUTO_RETURN);
127:     }
128: }
129: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0