How to use bundle products in configurable products?

By default magento does not allow to use bundle products in configurable products. You can change few files to make it work.

You needs to change two files:

1. app/code/core/Mage/Catalog/etc/config.xml


2. app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php

You need to manage stock based on bundle product in function getJsonConfig. Magento check stock based on simple product but bundle product use stock simple products. Default theme does not check in stock and out stock logic but any custom theme can have option.