What's the logic behind Bundle product's "Dynamic" vs. "Fixed" price? #2192
Replies: 1 comment 1 reply
-
I think without whomever originally wrote the code chiming in, we may never know what was going on here, whether there was some logic to it, or just a bug... It sure seems like a bug to me though. I continue to run into problems because of this. Mostly when trying to use data from the DB in other tools (@fballiano mentioned the same here), but at one point it was causing issues where inventory of simple items within a bundle/configurable item were not being properly returned to inventory, this may have been resolved though somewhere else though. I had submitted the original patch #275 which was rolled back in #2186. |
Beta Was this translation helpful? Give feedback.
-
Ok so as a follow-up to #2186 which got merged yesterday, I found out that I was still having issues with refunding the qty of some of our Bundle products after applying that fix, and so I fell into the rabbit hole of trying to figure out why this was happening.
After testing in a fresh installation with Magento 1.9 sample pack, I found that the price type in the Bundle product was the culprit. It's refunding the full qty of the Bundle children when the price type is set to "Dynamic", but only refunding the Bundle's qty when it's "Fixed", why's that? Considering that the qty of children is always decremented from the stock, wouldn't it make sense to refund it back all the time?
After digging deeper I found this snippet which sets the
product_calculations
value on the product options field:magento-lts/app/code/core/Mage/Bundle/Model/Product/Type.php
Lines 828 to 835 in b89b9a3
This value is then used indirectly by the method below through
Mage_Sales_Model_Order_Item::isDummy
to determine whether to refund the full children qty or only 1:magento-lts/app/code/core/Mage/Sales/Model/Order/Item.php
Lines 708 to 711 in b89b9a3
magento-lts/app/code/core/Mage/Sales/Model/Service/Order.php
Lines 227 to 230 in b89b9a3
Looking online it seems this issue is mostly thought of as a bug, but after looking at the source it seems to me it was intentional, but I can't get my head around why it works this way?
Beta Was this translation helpful? Give feedback.
All reactions