[contact-form-7 id="24078" title="Feedback EN"]

Featured templates

Magento. How to remove price in product option

Magento. How to remove price in product option

In this tutorial you will learn how to remove price in product option in Magento:

magento_remove_price_in_product_option-5

Please note that we will modify the Core Magento file.

  1. Open app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php file. Note that it is a core file, therefore you may want to copy it into local folder before making changes.

  2. Look for the following code: $select->addOption(

    magento_remove_price_in_product_option-1

  3. Remove $priceStr, so it looks as follows:

    $select->addOption(
    $_value->getOptionTypeId(),
    $_value->getTitle(),
    array('price' => $this->helper('core')->currencyByStore($_value->getPrice(true), $store, false))
    );

    magento_remove_price_in_product_option-2

  4. Look for the following code: $selectHtml.

    magento_remove_price_in_product_option-3

  5. Remove $priceStr, so it looks as follows:

    $selectHtml .= '<li>' . '<input type="' . $type . '" class="' . $class . ' ' . $require
    . ' product-custom-option"'
    . ($this->getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"')
    . ' name="options[' . $_option->getId() . ']' . $arraySign . '" id="options_' . $_option->getId()
    . '_' . $count . '" value="' . $htmlValue . '" ' . $checked . ' price="'
    . $this->helper('core')->currencyByStore($_value->getPrice(true), $store, false) . '" />'
    . '<span class="label"><label for="options_' . $_option->getId() . '_' . $count . '">'
    . $_value->getTitle() . ' ' . $priceStr . '</label></span>';
                

    magento_remove_price_in_product_option-4

  6. Save your changes. Upload this file to the server and reload your site page to see the changes:

    magento_remove_price_in_product_option-6

Feel free to check the detailed video tutorial below:

Magento. How to remove price in product option