As per heading, I have always wondered why both a configurable and simple are recorded when an order for a simple product is made?
Magento 1.9 example:
I can see that when an order is made, the simple product doesn't really contain much information except a reference to the parent product. The configurable product holds most of the relevant information such as the price, configurable options for the particular simple product in the 'product_options' field, etc.
However, if I update the simple product with price, options, etc, and delete the configurable product, it still displays exactly the same way on the Magento admin order screen.
'product_options' field sample:
a:6:{s:15:"info_buyRequest";a:3:{s:3:"qty";i:1;s:15:"super_attribute";a:3:{i:81;s:2:"12";i:92;s:2:"64";i:132;s:1:"6";}s:7:"options";a:0:{}}s:15:"attributes_info";a:3:{i:0;a:2:{s:5:"label";s:12:"Manufacturer";s:5:"value";s:1:"A";}i:1;a:2:{s:5:"label";s:5:"Color";s:5:"value";s:8:"Light T1";}i:2;a:2:{s:5:"label";s:4:"size";s:5:"value";s:1:"S";}}s:11:"simple_name";s:22:"Samsung Galaxy S6 Note";s:10:"simple_sku";s:29:"Samsung-Galaxy-S6";s:20:"product_calculations";i:1;s:13:"shipment_type";i:0;}
The reason I ask is that I am importing orders into Magento - I am only importing simple products (if they're children of configurable products) and it appears that I can achieve the same behavior as what is currently default.
Is there anything I am missing by doing this? Will it impact any functionality? Doesn't seem to have any impact on invoices, shipments, front-end-display, etc. What is the point of having two lines for the same product?
Thank you.
EDIT: As per answer/comment. I reduce inventory like so:
$stockItemsFullSave = Mage::getModel('cataloginventory/stock')->registerProductsSale($stockItems);
If order fails, I don't add stockItemsFullSave to a transaction I use to save order/invoice and inventory, and roll back using standard functionality:
Mage::getModel('cataloginventory/stock')->revertProductsSale($stockItems);
I would assume this would decrement stock correctly and control all things related to inventory?