Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7583955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:48:26+00:00 2026-05-30T18:48:26+00:00

I’m building an extension to add a specific block right before the ‘Place Order’

  • 0

I’m building an extension to add a specific block right before the ‘Place Order’ button in Magento’s Onepage checkout. I’m having some trouble finding the right incantations to simply append a block to this section, much less get it before/after another handle. The object is to engage this override without any template changes.

In my extension’s XML, I have:

<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>

myextension/block.phtml is, for now, just a simple block of text. I know the general syntax is correct, as I’m able to add my <block> to checkout_cart_index and see it just fine.
Am I missing something basic?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:48:27+00:00Added an answer on May 30, 2026 at 6:48 pm

    Background

    Not all blocks output their children blocks automatically. Only blocks of the core/text_list type and templates where echo $this->getChildHtml() (no arguments) s called.
    Children of template blocks are rendered by a call to echo $this->getChildHtml('child_alias').
    It makes sense if you think about it – children of template blocks need to be positioned somewhere in the context of the template HTML.
    Referring to your question, there is no functional difference between the layout handles checkout_onepage_review and checkout_cart_index besides them referring to different pages.

    Adding content to the checkout review

    The checkout review block contains two core/text_list children to whom you can add children using layout XML that will automatically be displayed.

    <checkout_onepage_review>
        <reference name="checkout.onepage.review.info.items.before">
            <block type="core/text" name="review.test.1">
                <action method="setText">
                    <text>Test Block Before</text>
                </action>
            </block>
        </reference>
        <reference name="checkout.onepage.review.info.items.after">
            <block type="core/text" name="review.test.2">
                <action method="setText">
                    <text>Test Block After</text>
                </action>
            </block>
        </reference>
    </checkout_onepage_review>
    

    The only problem is that the checkout.onepage.review.info.items.after block is rendered before the agreements block, so in your case it might not be good enough.
    The agreements are rendered with this code:

    <?php foreach ($this->getAgreements() as $_a): ?>
        <li>
            <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
                <?php if ($_a->getIsHtml()):?>
                    <?php echo $_a->getContent() ?>
                <?php else:?>
                    <?php echo nl2br($this->htmlEscape($_a->getContent())) ?>
                <?php endif; ?>
            </div>
            <p class="agree">
                <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->htmlEscape($_a->getCheckboxText()) ?>" class="checkbox" /><label for="agreement-<?php echo $_a->getId()?>"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->htmlEscape($_a->getCheckboxText()) ?></label>
            </p>
        </li>
    <?php endforeach ?>
    

    If you want to add a block after the agreements, right before the “Place Order” button, without changing the template, and without rewriting the agreements block, you can try to add an additional item to the end of the checkout/agreements collection, having is_html set to true, and your output as the content.
    This turns out to be problematic, though, because the agreements model, resource, and collection don’t offer a custom event prefix.

    What this boils down to, if the provided checkout.onepage.review.info.items.after block doesn’t work, are the following options. Each one is ugly in it’s own way, so the choice of the smallest evil is yours:

    • Observe the core_block_abstract_to_html_before mentioned in the post linked to in the comments
    • Observe the core_collection_abstract_load_before event and add a html agreement on the fly
    • Rewrite the checkout/agreements block and overload the _toHtml() method

    My recommendation would be to somehow make use of the checkout.onepage.review.info.items.after block – that solution would be so much nicer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.