0
votes

I'm looking for help with a rather frustrating Magento issue I can't seem to get my head around.

On our Magento site we have several Bundled Products. These work fine etc but all the items of the Bundled Product are displayed on the page; it makes the page unnecessarily long & the list isn't need as the items are fixed, customers can not change or edit any of the items.

Ideally what I would like to do is stop those items being displayed so it looks more like a normal product page.

I have tried editing the view.phtml file located in:

app/design/frontend/default/my_theme/template/catalog/product/

I found the following blocks of code:

<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php endif;?>

<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif;?>

When the 'container2' lines are removed, it does remove the list of bundled items but also removes the 'Add to cart' button too.

Would appreciate any help on this as I haven't been able to resolve this issue using Google Sensei.

2

2 Answers

0
votes
Step:1 First Remove below Lines from --template\catalog\product\view.phtml 

if ($_product->isSaleable() && $this->hasOptions()):?>
                <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif; ?>

Step2: Add Below Lines inplace of Above lines

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/view/addtocart.phtml')->toHtml(); ?>



Step3: --template\catalog\product\view\addtocart.phtml
Remove All Lines from file and add below code
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>

<div class="add-to-cart">
    <?php  ?>
    <label for="qty"><?php echo $this->__('Qty:') ?></label>
    <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />

    <!--<button type="button" title="<?php echo $this->__('Add to Cart') ?>"        class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product)   ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>-->
    <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart"  onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button></p>
    <?php echo $this->getChildHtml('', true, true) ?>
</div>

Step4: - Go to admin panel, Go to products and if custom Options are marked as required mark them as not required.

See this screen shot for more info

Thanks...

0
votes

Although this is a very old issue, but thought this might be useful for someone who runs into the requirement. All you would want to do is, edit the .phtml file which renders the Bundle items.

This is how I solved it:

Usually the file you would want to edit would be: YOUR_THEME->default->template->bundle->catalog->product->view->type->bundle->option->select.phtml

If you cant find this path in your theme, then:

Step1) Turn on Template hint from System->Configuration. Click on Developer, and under Debug tab, Enable the Template hint.

Step 2) Refresh or go to the product view page, where your bundle items are listed, locate the file through template hint.

Once you are in select.phtml file, you can do whatever you want to hide or display or change the code. I just added a div with "display:none" style, and it hid the whole "Bundle Item" block.