Removing price from item-options in Magento checkout cart

Removing price from item-options in Magento checkout cart

September 24, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Removing price from item-options in Magento checkout cart

Removing Price from Item-Options in Magento Checkout Cart

Introduction

Are you looking for a way to remove the price value of an item-option from your Magento checkout cart? This can be a useful feature if you want to display only the option text without the associated cost. In this guide, we will walk through the steps required to achieve this.

Understanding the Problem

The issue lies in the way Magento renders the item-options in the cart view. By default, it displays both the label and the formatted option value (including the price). You can find this code snippet in app/design/frontend/base/default/template/checkout/cart/item/default.phtml.

<?php if ($_options = $this->getOptionList()): ?>
    <dl class="item-options">
        <?php foreach ($_options as $_option) : ?>
            <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
            <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
            <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
                <?php echo $_formatedOptionValue['value'] ?>
                <?php if (isset($_formatedOptionValue['full_view'])): ?>
                    <div class="truncated_full_value">
                        <dl class="item-options">
                            <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
                            <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
                        </dl>
                    </div>
                <?php endif; ?>
            </dd>
        <?php endforeach; ?>
    </dl>
<?php endif; ?>

In the <dd> element, both the option value and its price are being echoed out.

The Solution: Overriding the Template File

To remove the price from the item-option in the checkout cart, we need to override this template file. This can be done using theme inheritance or a module.

Using Theme Inheritance:

  1. Navigate to your theme directory (e.g., app/design/frontend/Vendor/Theme).
  2. Create a new folder named template if it doesn’t exist.
  3. Inside the template folder, create another folder called checkout.
  4. Inside the checkout folder, create yet another folder called cart.
  5. Inside the cart folder, copy the item/default.phtml file from app/design/frontend/base/default/template/checkout/cart/item/.

Using a Module: If you prefer to use a module:

  1. Create a new folder for your module (e.g., app/code/Vendor/Module).
  2. Inside the etc folder, create the necessary XML files for theme configuration.
  3. Inside the view/frontend/templates/checkout/cart/item/ folder, place a copy of the default.phtml file.

Editing the Template File

Once you have created the override file:

  1. Open your copied version of item/default.phtml.
  2. Locate the section where the option value is being echoed out.
  3. Modify this code as follows:
<?php if ($_options = $this->getOptionList()): ?>
    <dl class="item-options">
        <?php foreach ($_options as $_option) : ?>
            <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
            <dd class="truncated"><?php echo substr($_formatedOptionValue['value'], 0, strrpos($_formatedOptionValue['value'], '€')) ?></dd>
        <?php endforeach; ?>
    </dl>
<?php endif; ?>

We are using the substr() function to truncate the option value string at the position of the currency symbol (€), effectively removing the price.

Conclusion

Removing the price from item-options in a Magento checkout cart is a straightforward process that involves overriding the default template file. By following the steps outlined above, you can achieve this without having to modify any core files.

Remember that overriding templates using themes or modules allows for easier updates and reduces the risk of losing your changes during Magento upgrades. Always ensure you have a backup before making these modifications.

For more advanced customization techniques and professional support, consider reaching out to Laravel Company, where our team of experienced developers can help you optimize your Magento store’s performance and functionality.

Happy coding!

Checkout Themes Pricing Errors

Our network