Magento Show Multiple Discounts Breakdown

Magento Show Multiple Discounts Breakdown

August 31, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Show Multiple Discounts Breakdown

Separating Discounts in Magento: A Comprehensive Guide

As an experienced e-commerce developer, I often receive queries about customizing the way discounts are displayed on Magento shopping cart pages. One common issue is when multiple discount types - such as reward points and coupon codes - appear grouped together under a single label.

In this post, we’ll tackle how to separate these discounts so that each one appears in its own row on the checkout page. I’ll provide step-by-step guidance along with code snippets to help you achieve this separation effectively.

Understanding Magento’s Discount Structure

Before diving into the solution, it’s important to understand how Magento processes and displays discounts. The platform combines all available discounts, applying them sequentially based on priority settings.

When multiple discounts are applied, they can appear grouped together if Magento considers them of the same type or with similar precedence. In your case, both reward points and coupon codes from shopping cart promotions are treated as discount types by default.

Separating Discounts: The Approach

To separate these discounts into distinct rows, we’ll need to modify how Magento renders the summary block on the checkout page. This involves creating a custom layout update that changes the template file for the ‘summary’ block.

Here’s a step-by-step guide:

  1. Create a new XML layout

In your theme folder (usually found at app/design/frontend/{package}/{theme}/layout), create a new XML file named checkout_cart_index.xml. This will be used to specify our custom layout update.

  1. Write the layout update

Open the newly created file and add the following content:

<reference name="checkout.cart.summary">
    <action method="setTemplate">
        <area>empty</area>
        <file>LaravelCompany_CustomDiscounts::discounts.phtml</file>
    </action>
</reference>

Replace empty with your actual template file for the summary block. If you don’t have a custom template, you can create one in your theme folder at app/design/frontend/{package}/{theme}/template/checkout/summary.

  1. Create the custom discounts template

In the same template folder (app/design/frontend/{package}/{theme}/template/checkout/summary), create a new file named discounts.phtml. This will be used to render the separated discount rows.

  1. Implement the custom discounts rendering

Open the newly created discounts.phtml file and replace its content with the following code:

<?php
/* @var $this Mage_Checkout_Block_Cart_Summary */

/**
 * Magento will automatically inject the cart object into this template.
 */
?>

<div class="cart-discount">
    <?php if ($this->getCouponCode()): ?>
        <p>
            <label for="coupon_code"><?php echo $this->__('Discount Codes') ?>:</label>
            <input type="text" name="coupon_code" id="coupon_code" value="<?php echo $this->escapeHtml($this->getCouponCode()) ?>" class="input-text"/>
        </p>
    <?php endif; ?>

    <?php if ($this->hasRewardPointsDiscount()): ?>
        <p>
            <label for="reward_points"><?php echo $this->__('Reward Points') ?>:</label>
            <input type="text" name="reward_points" id="reward_points" value="<?php echo $this->escapeHtml($this->getRewardPointsDiscount()) ?>" class="input-text"/>
        </p>
    <?php endif; ?>
</div>

This code checks for the existence of coupon codes and reward points discounts separately. It renders them using individual <p> elements, ensuring they appear as distinct rows on the checkout page.

  1. Clear cache

Finally, make sure to clear your Magento cache after making these changes. You can do this through the admin panel or by running the following command:

php -f shell/indexer.php reindexall

Conclusion

Separating discounts in Magento requires a combination of custom layout updates and template modifications. By creating a new XML layout update file and specifying a custom summary block template, we can override Magento’s default rendering behavior.

Our custom discounts.phtml template checks for the presence of coupon codes and reward points separately, ensuring they appear as distinct rows on the checkout page. This approach respects the unique nature of each discount type while providing a clear breakdown for your customers.

Remember to replace placeholders like {package} and {theme} with your actual theme package name and theme name. Also, ensure that you have properly configured the reward points module and shopping cart promotions for applicable discounts.

By following this comprehensive guide, you should now be able to display separate rows for each discount type on your Magento checkout page, enhancing the user experience for your customers.

Checkout Themes Configuration Pricing

Our network