0

This is my layout:

<checkout_onepage_success translate="label">
        <label>One Page Checkout Success</label>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="core/template" name="kryd_checkout_success" template="kryd/success.phtml"/>
        </reference>
    </checkout_onepage_success>

I want to change the core/template to access my block from my custom module. This is my block path:

app/code/community/KRYD/Observer/Block/Checkout/Success.php

This is my block content:

<?php
class KRYD_Observer_Block_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
{

}

This is my block declaration from my config.xml:

<global>
        <blocks>
           <KRYD_Observer>
               <class>KRYD_Observer_Block</class>
           </KRYD_Observer>
        </blocks>
</global>

If i leave the core/template I get the content from my new template file. These are what I tried:

<block type="observer/checkout_success" name="kryd_checkout_success" template="kryd/success.phtml"/>

or

<block type="kryd_observer/checkout_success" name="kryd_checkout_success" template="kryd/success.phtml"/>

If I leave the kryd_observer , it doesn't load any template. Smth I missed. Can you help me with this ?

0

Change your block declaration in your config.xml with the following:

<global>
        <blocks>
           <kryd_observer>
               <class>KRYD_Observer_Block</class>
           </kryd_observer>
        </blocks>
</global>

The block namespace is case sensitive.

PS: and this code will work:

<block type="kryd_observer/checkout_success" name="kryd_checkout_success" template="kryd/success.phtml"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.