It is the same way with configurable products.
If you are looking for white shoes and the configurable products solves this problem for you, the product is offered. I think it is easy as this. So if your searched product is part of a bundle product, this product is offered too.
The way to achieve this is to edit the following files:
/app/design/frontend/[YOUR_THEME]/[YOUR_CHILD]/template/bundle/catalog/product/view/type/bundle/option/radio.phtml
/app/design/frontend/[YOUR_THEME]/[YOUR_CHILD]/template/bundle/catalog/product/view/type/bundle/option/select.phtml
You need to find the line that looks like this (this may be slightly different depending on your theme):
<input class="txtIn qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>" />
and replace with:
<?php if (!$_canChangeQty): ?>
<input class="txtIn qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>" />
<?php else: ?>
<select class="txtIn qty" onclick="bundle.changeOptionQty(this, event)" onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" id="bundle-option-<?php echo $_option->getId() ?>-qty-input" type="select" name="bundle_option_qty[<?php echo $_option->getId() ?>]" >
<?php if (!$_option->getRequired()): ?>
<option value="0">0</option>
<?php endif; ?>
<option value="1" <?php if ($_defaultQty=='1'): ?>selected<?php endif; ?>>1</option>
<option value="2" <?php if ($_defaultQty=='2'): ?>selected<?php endif; ?>>2</option>
<option value="3" <?php if ($_defaultQty=='3'): ?>selected<?php endif; ?>>3</option>
<option value="4" <?php if ($_defaultQty=='4'): ?>selected<?php endif; ?>>4</option>
<option value="5" <?php if ($_defaultQty=='5'): ?>selected<?php endif; ?>>5</option>
<option value="6" <?php if ($_defaultQty=='6'): ?>selected<?php endif; ?>>6</option>
<option value="7" <?php if ($_defaultQty=='7'): ?>selected<?php endif; ?>>7</option>
<option value="8" <?php if ($_defaultQty=='8'): ?>selected<?php endif; ?>>8</option>
<option value="9" <?php if ($_defaultQty=='9'): ?>selected<?php endif; ?>>9</option>
<option value="10" <?php if ($_defaultQty=='10'): ?>selected<?php endif; ?>>10</option>
<option value="11" <?php if ($_defaultQty=='11'): ?>selected<?php endif; ?>>11</option>
<option value="12" <?php if ($_defaultQty=='12'): ?>selected<?php endif; ?>>12</option>
<option value="13" <?php if ($_defaultQty=='13'): ?>selected<?php endif; ?>>13</option>
<option value="14" <?php if ($_defaultQty=='14'): ?>selected<?php endif; ?>>14</option>
<option value="15" <?php if ($_defaultQty=='15'): ?>selected<?php endif; ?>>15</option>
<option value="16" <?php if ($_defaultQty=='16'): ?>selected<?php endif; ?>>16</option>
<option value="17" <?php if ($_defaultQty=='17'): ?>selected<?php endif; ?>>17</option>
<option value="18" <?php if ($_defaultQty=='18'): ?>selected<?php endif; ?>>18</option>
<option value="19" <?php if ($_defaultQty=='19'): ?>selected<?php endif; ?>>19</option>
<option value="20" <?php if ($_defaultQty=='20'): ?>selected<?php endif; ?>>20</option>
</select>
<?php endif; ?>
As you will see, this looks to see if the quantity can actually be changed and, if it can, uses a dropdown menu with quantities 0-20. The if statement around the 0 ensures that 0 is only available if the item is not a required item in the bundle.
Best Answer
You can use the following code to check whether the required child items of a bundle product are salable.
After that you can use the variable
$isSalable
to decide whether the product is salable or not.EDITED
In this case will be better to rewrite the class "Mage_Bundle_Model_Product_Type" and rewrite the method "Mage_Bundle_Model_Product_Type::isSalable". If you have your custom module you can do it as described below. To rewrite the class edit the file "app/code/community/Namespace/Module/etc/config.xml":
Then create the file: "app/code/community/Namespace/Module/Model/Product/Type.php" and insert the following code: