mage-os / mageos-magento2

Work in progress.
Open Software License 3.0
208 stars 41 forks source link

Draft: Fix autochanging stock for new configurable product #88

Closed vpodorozh closed 6 months ago

vpodorozh commented 7 months ago

Description

Introduce configurable product stock status assement and update based on it\'s child products. Required while creation of configurable product - as all checks realted to autoset of stock status are executed first on simple product, then on configurable while its creation. This leads to not calling processStockForParent method on configurable product - but it should, to set correct stock status for configurable based on child products.

Fixed Issues

https://github.com/mage-os/mageos-magento2/issues/84

vpodorozh commented 7 months ago

@Vinai - I would like to discuss these changes with you.
I've executed full list of integration tests with those changes and I actually see new problems caused by this fix.

  1. The tests it meant to fix had not state in time when they were green - at least in 2.4-develop branch.
  2. Test is covering edge case when configurable product is created with simple that is out of stock - and expects to have configurable product stock item be also out of stock. However, this is not how the stock status of configurable product is checked and used across magento - so I doubt the need of this test.
  3. debugging and handling this took me a lot of time and further investigation would take even more I'm afraid
  4. as mentioned in point 1 - it used to work like this always and everyone is fine with this behaviour.

Based on those factors I would suggest this about skipping current failed test instead of spending hours fixing it.