This example is to override Mage_CatalogInventory_Model_Observer. The purpose of the overriding is NOT TO return the items of cancelled orders back to stock.
1. app/etc/modules/SD_NoItemStock.xml:
Run Magento mysql query
$resource = Mage::getSingleton('core/resource');$writeConnection = $resource->getConnection('core_write');$table = $resource->getTableName('productalert/stock');$productId = $_item->getProductId();$date = '2099-09-12 16:38:36';$query = "UPDATE {$table} SET stock_update_date = '{$date}' WHERE…
Config.xml
<events> <cataloginventory_stock_item_save_commit_after> <observers> <genmato_stockupdate> <class>genmato_stockupdate/observer</class>…
Some time we need to test specific code in magento , debugging the whole process can be frustrating so for short cut you can use a test.php file .
Test App
require 'app/Mage.php';if (!Mage::isInstalled()) { echo "Application is not installed…
Orders data are saved in database tables sales_flat_order and sales_flat_order_item
sales_flat_order
sales_flat_order_item
Discounts are applied in Mage_SalesRule_Model_Validator
Mage_SalesRule_Model_Validator