I have a custom module and created a block handle in my configuration file as below


Then created a block file inside app/code/local/ucs/OneStepCheckout as below

class Ucs_OneStepCheckout_Block_Review extends Mage_Core_Block_Template
    public function getReviewTemplate()
        return 'Success';


Then trying to create the getReviewTemplate from theme/checkout/onepage.phtml as below

                echo '<pre>'; print_r($block);

It throws the error as below

Fatal error: Call to a member function getReviewTemplate() on a non-object

What is the wrong with my code?

2 Answers 2


You block type is wrong should be


should be


It logic like :


onestepcheckout block type prefix / group name of module Ucs_OneStepCheckout Module as you define at config.xml

<blocks> <onestepcheckout><!-- this is called as block type prefix / group name of module Ucs_OneStepCheckout --> <class>Ucs_OneStepCheckout_Block</class> </onestepcheckout> ....

If you want to call Ucs_OneStepCheckout_Block_Review class as block type then convert like this:

  • Ucs_OneStepCheckout_Block = onestepcheckout

Review = review

Between Block groupName & rest of class name a / should come.

So block type is onestepcheckout/review


It's onestepcheckout/review, not onestepcheckout_review (class group alias, slash, snake cased rest of the class name)


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.