Description
When ordering a bundle product (for instance the sample data provides the Yoga Kit) - the bundle options are not shown on the items ordered tab of the my account section.
Environment: Magento v2.2.2 with Sample Data (can't see a fix in other newer release notes)
Steps to reproduce
- Install Magento v2.2.2 with sample data
- Create an account then purchase the Yoga Kit (Bundle Product) on its own
- Visit the My Orders section in My Account
- View the Items Ordered tab
Expected result
Parent product with the options underneath (as is shown on the invoice tab)
Actual result
Only parent product is listed
Preconditions
- PHP 7.0 and PHP 7.1 tested
- MySQL 5.6 / 5.7
- Magento 2.2.2 via create-project
- Sample Data installed (but also broken on live website with real products)
What I've debugged so far
Looking through the files, I can see that the $parentItem->getChildrenItems() within the renderer template for bundle returns empty.
Looking deeper into the problem, the magento-sales\Model\Order\Item.php does in fact call addChildItem() which should append to the $this->_children property array.
getChildrenItems() should simply pull this array - it looks like between this class being constructed (with child items) and called, this property is being cleared.