<?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_CatalogInventory
 * @copyright   Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
-->
<config>
    <modules>
        <Mage_CatalogInventory>
            <version>1.6.0.0.2</version>
        </Mage_CatalogInventory>
    </modules>
    <global>
        <models>
            <cataloginventory>
                <class>Mage_CatalogInventory_Model</class>
                <resourceModel>cataloginventory_resource</resourceModel>
            </cataloginventory>
            <cataloginventory_resource>
                <class>Mage_CatalogInventory_Model_Resource</class>
                <deprecatedNode>cataloginventory_mysql4</deprecatedNode>
                <entities>
                    <stock>
                        <table>cataloginventory_stock</table>
                    </stock>
                    <stock_item>
                        <table>cataloginventory_stock_item</table>
                    </stock_item>
                    <stock_status>
                        <table>cataloginventory_stock_status</table>
                    </stock_status>
                    <stock_status_indexer_idx>
                        <table>cataloginventory_stock_status_idx</table>
                    </stock_status_indexer_idx>
                    <stock_status_indexer_tmp>
                        <table>cataloginventory_stock_status_tmp</table>
                    </stock_status_indexer_tmp>
                </entities>
            </cataloginventory_resource>
        </models>
        <helpers>
            <cataloginventory>
                <class>Mage_CatalogInventory_Helper</class>
            </cataloginventory>
        </helpers>
        <resources>
            <cataloginventory_setup>
                <setup>
                    <module>Mage_CatalogInventory</module>
                    <class>Mage_Eav_Model_Entity_Setup</class>
                </setup>
            </cataloginventory_setup>
        </resources>
        <blocks>
            <cataloginventory>
                <class>Mage_CatalogInventory_Block</class>
            </cataloginventory>
        </blocks>
        <events>
            <catalog_block_product_status_display>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>displayProductStatusInfo</method>
                    </inventory>
                </observers>
            </catalog_block_product_status_display>
            <catalog_product_load_after>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>addInventoryData</method>
                    </inventory>
                </observers>
            </catalog_product_load_after>
            <catalog_product_clear>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>removeInventoryData</method>
                    </inventory>
                </observers>
            </catalog_product_clear>
            <catalog_product_collection_load_after>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>addStockStatusToCollection</method>
                    </inventory>
                </observers>
            </catalog_product_collection_load_after>
            <catalog_product_prepare_index_select>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>prepareCatalogProductIndexSelect</method>
                    </inventory>
                </observers>
            </catalog_product_prepare_index_select>
            <sales_quote_item_collection_products_after_load>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>addInventoryDataToCollection</method>
                    </inventory>
                </observers>
            </sales_quote_item_collection_products_after_load>
            <sales_quote_item_qty_set_after>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>checkQuoteItemQty</method>
                    </inventory>
                </observers>
            </sales_quote_item_qty_set_after>
            <checkout_submit_all_after>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>checkoutAllSubmitAfter</method>
                    </inventory>
                </observers>
            </checkout_submit_all_after>
            <sales_model_service_quote_submit_before>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>subtractQuoteInventory</method>
                    </inventory>
                </observers>
            </sales_model_service_quote_submit_before>
            <sales_model_service_quote_submit_success>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>reindexQuoteInventory</method>
                    </inventory>
                </observers>
            </sales_model_service_quote_submit_success>
            <sales_model_service_quote_submit_failure>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>revertQuoteInventory</method>
                    </inventory>
                </observers>
            </sales_model_service_quote_submit_failure>
            <sales_order_item_cancel>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>cancelOrderItem</method>
                    </inventory>
                </observers>
            </sales_order_item_cancel>
            <sales_order_creditmemo_save_after>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>refundOrderInventory</method>
                    </inventory>
                </observers>
            </sales_order_creditmemo_save_after>
            <catalog_product_save_after>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>saveInventoryData</method>
                    </inventory>
                </observers>
            </catalog_product_save_after>
            <catalog_model_product_duplicate>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>copyInventoryData</method>
                    </inventory>
                </observers>
            </catalog_model_product_duplicate>
            <admin_system_config_changed_section_cataloginventory>
                <observers>
                    <inventory>
                        <class>cataloginventory/observer</class>
                        <method>updateItemsStockUponConfigChange</method>
                    </inventory>
                </observers>
            </admin_system_config_changed_section_cataloginventory>
            <prepare_catalog_product_index_select>
                <observers>
                    <cataloginventory>
                        <class>cataloginventory/observer</class>
                        <method>prepareCatalogProductIndexSelect</method>
                    </cataloginventory>
                </observers>
            </prepare_catalog_product_index_select>
            <end_index_events_cataloginventory_stock_item_save>
                <observers>
                    <cataloginventory>
                        <class>cataloginventory/observer</class>
                        <method>reindexProductsMassAction</method>
                    </cataloginventory>
                </observers>
            </end_index_events_cataloginventory_stock_item_save>
            <end_process_event_cataloginventory_stock_item_save>
                <observers>
                    <cataloginventory>
                        <class>cataloginventory/observer</class>
                        <method>reindexProductsMassAction</method>
                    </cataloginventory>
                </observers>
            </end_process_event_cataloginventory_stock_item_save>
            <prepare_product_children_id_list_select>
                <observers>
                    <cataloginventory>
                        <class>cataloginventory/observer</class>
                        <method>prepareCatalogProductIndexSelect</method>
                    </cataloginventory>
                </observers>
            </prepare_product_children_id_list_select>
        </events>
        <catalog>
            <product>
                <type>
                    <simple>
                        <is_qty>1</is_qty>
                    </simple>
                    <virtual>
                        <is_qty>1</is_qty>
                    </virtual>
                    <configurable>
                        <stock_indexer>cataloginventory/indexer_stock_configurable</stock_indexer>
                    </configurable>
                    <grouped>
                        <stock_indexer>cataloginventory/indexer_stock_grouped</stock_indexer>
                    </grouped>
                </type>
            </product>
        </catalog>
        <index>
            <indexer>
                <cataloginventory_stock>
                    <model>cataloginventory/indexer_stock</model>
                </cataloginventory_stock>
                <catalog_product_attribute>
                    <depends>
                        <cataloginventory_stock/>
                    </depends>
                </catalog_product_attribute>
                <catalog_product_price>
                    <depends>
                        <cataloginventory_stock/>
                    </depends>
                </catalog_product_price>
            </indexer>
        </index>
    </global>
    <frontend>
        <layout>
            <updates>
                <cataloginventory>
                    <file>cataloginventory.xml</file>
                </cataloginventory>
            </updates>
        </layout>
        <translate>
            <modules>
                <Mage_CatalogInventory>
                    <files>
                        <default>Mage_CatalogInventory.csv</default>
                    </files>
                </Mage_CatalogInventory>
            </modules>
        </translate>
    </frontend>
    <adminhtml>
        <translate>
            <modules>
                <Mage_CatalogInventory>
                    <files>
                        <default>Mage_CatalogInventory.csv</default>
                    </files>
                </Mage_CatalogInventory>
            </modules>
        </translate>
        <events>
            <after_reindex_process_cataloginventory_stock>
                <observers>
                    <cataloginventory>
                        <class>cataloginventory/observer</class>
                        <method>reindexProductsMassAction</method>
                    </cataloginventory>
                </observers>
            </after_reindex_process_cataloginventory_stock>
        </events>
    </adminhtml>
    <default>
        <cataloginventory>
            <options>
                <can_subtract>1</can_subtract>
                <can_back_in_stock>1</can_back_in_stock>
                <show_out_of_stock>0</show_out_of_stock>
                <stock_threshold_qty>0</stock_threshold_qty>
                <display_product_stock_status>1</display_product_stock_status>
            </options>
            <item_options>
                <manage_stock>1</manage_stock>
                <backorders>0</backorders>
                <max_sale_qty>10000</max_sale_qty>
                <min_sale_qty>1</min_sale_qty>
                <min_qty>0</min_qty>
                <notify_stock_qty>1</notify_stock_qty>
                <enable_qty_increments>0</enable_qty_increments>
                <qty_increments>1</qty_increments>
            </item_options>
        </cataloginventory>
    </default>
</config>
