Adding blocks in Magento's Checkout 'Review' stage

Adding blocks in Magento's Checkout 'Review' stage

August 11, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Adding blocks in Magento's Checkout 'Review' stage

Expanding a Block in Magento’s Checkout Review Stage

In Magento, customizing the checkout process often requires understanding how to override existing blocks and handles. If you’re trying to insert a specific block before or after another handle without touching any templates, this guide will help you achieve that.

Understanding Magento Layouts and Blocks

Magento uses XML layouts to define the structure of its pages. Each layout file (like checkout.xml) contains definitions for your store’s page structures. Within these files, you can add, modify, or remove blocks that get rendered on the page.

Your Current Setup: Appending a Block

In your extension’s etc/frontend/checkout_onepage_review.xml file, you’re already on the right track:

<checkout_onepage_review>
    <reference name="root">
        <block type="myextension/blockname" name="myextension.block" template="myextension/block.phtml" before="checkout.onepage.review.button" />
    </reference>
</checkout_onepage_review>

Here, you’re targeting the root handle of Magento’s checkout review page. The before attribute specifies that your block (myextension.block) should be inserted right before the checkout.onepage.review.button handle.

Debugging Your Issue

If your block is appearing elsewhere (like checkout_cart_index), there might be a conflict in your layout XML files. Make sure you’re not overriding any other layouts that could pull in this block unexpectedly.

Also, double-check your module’s order of precedence. Magento processes layout updates based on the sequence defined in app/etc/modules/. Ensure your extension is loaded after the necessary Magento core modules (like Mage_Checkout).

A Common Mistake: Using Deprecated Block Types

In your XML code, you’re using a block type (myextension/blockname). In recent versions of Magento, the recommended approach is to use class names instead:

<reference name="root">
    <block class="Magento\Framework\View\Element\Template" name="myextension.block" template="MyExtension_Block::block.phtml" before="checkout.onepage.review.button" />
</reference>

Replace MyExtension with the actual namespace of your module. This change ensures compatibility with Magento’s dependency injection system.

Testing Your Block

Before running this code, make sure you have a valid block template (myextension/block.phtml) that simply echoes some text:

<div>This is my custom review stage block.</div>

Remember to clear your cache after making changes. In Magento 2, you can do this via the admin panel (System > Cache Management) or with the following command:

bin/magento cache:clean

Conclusion

To add a block before/after another handle in Magento’s checkout review stage without touching any templates, use layout XML updates as demonstrated above. Ensure your module is properly configured, and always double-check for conflicts.

If you’re still facing issues, remember that Magento’s structure can sometimes be complex. Consider using tools like Magento 2 Layout and Block Visualizer to visualize your layout files and understand how blocks are rendered on the page.

This guide should help you successfully append a block before/after another handle in Magento’s checkout review stage. Happy coding!

Checkout Extensions Themes Errors

Our network