Magento – How to remove the +$0.00 from product bundle options

bundled-productce-1.9.0.1custom-optionsdropdown-attributeprice

I have a product Bundle with a few dropdown options. In the dropdown I have a number of options the customer can choose from (simple products) and only one of them adds to the price of the bundle. Yet Magento includes "+$0.00" next to every single option in the dropdown. It looks too confusing to have so many options which all have +$0.00 next to them, yet I don’t want to hide that field entirely since one of the options does add $10.00 to the price.

How do I get Magento to only display the +$x.xx if there is an increase/decrease and hide this text if it’s $0.00?

If that isn't possible (or advisable to hack the core) I'm thinking I could hide the field entirely with CSS and just rename any sub-products that have a price change like "Product Name +$5.00" so it mimics the behavior. BUT, I can't figure out how to hide that particular field with CSS.

Trying to launch my site soon and this issue is bugging me – any ideas for either solution? Thanks in advance!

Magento CE 1.9.0.1

Thanks!

Best Answer

Go to the file: app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/

Choose your selection method:

I am writing the below code for select.phtml

The simple process is to change (see the code in bold):

<?php if ($this->_showSingle()): ?>
        <?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
        <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
    <?php else:?>
        <select onchange="bundle.changeSelection(this)" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname">
            <option value=""><?php echo $this->__('Choose a selection...') ?></option>
        <?php foreach ($_selections as $_selection): ?>
            <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option>
        <?php endforeach; ?>
        </select>
    <?php endif; ?>

TO

<?php if ($this->_showSingle()): ?>
        **<?php echo $_selections[0]->getName()?>**
        <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
    <?php else:?>
        <select onchange="bundle.changeSelection(this)" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname">
            <option value=""><?php echo $this->__('Choose a selection...') ?></option>
        <?php foreach ($_selections as $_selection): ?>
            <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php echo $_selection->getName() ?></option>
        <?php endforeach; ?>
        </select>
    <?php endif; ?>
Related Topic