Daniel Vickers
Daniel Vickers

Reputation: 1074

Magento: Insert Static Block into the Progress block of the Onepage Checkout

I am trying to add my static block into the Magento one page checkout. More specifically under the Progress section of the page (see attached image). Unfortunately I cannot find anything online nor does my code seem to work. Any ideas?

local.xml

    <!-- Checkout Page -->
    <checkout_onepage_progress>    
        <remove name="right"/>
        <remove name="left"/>
        <block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress.phtml">
            <action method="setInfoTemplate"><method></method><template></template></action>
            <block type="cms/block" name="card_scheme_marks"></block>
        </block>
    </checkout_onepage_progress>

progress.phtml

    <div id="payment-card-scheme-marks">
        <?php echo $this->getChildHtml('card_scheme_marks') ;?>
    </div>

Static Block In Backend: static block in back end

Checkout page, the progress section is on the right: one page checkout

Upvotes: 0

Views: 557

Answers (1)

Charles
Charles

Reputation: 1122

In your local.xml you need to reference the block you want to update instead of recreating it. Once that is done you can make your CMS block and assign the correct id to it. The block will be a child of the one you're referencing so you will still need your $this->getChildHtml();

<!-- Checkout Page -->
<checkout_onepage_index>
    <reference name="checkout.progress">
        <block type="cms/block" name="card_scheme_marks">
            <action method="setBlockId"><block_id>card_scheme_marks</block_id></action>
        </block>
    </reference>
</checkout_onepage_index>

Upvotes: 1

Related Questions