0

I want to rewrite Mage/Payment/Block/Form/Container.php with another file inside my module.

In my module's config file, I have:

<global>
  <blocks>
     <payment_form>
         <rewrite>
            <container>Mynamespace_Module_Block_Form_Container</container>
         </rewrite>
     </payment_form>
  </blocks>
</global>

I've also tried this:

<global>
 <blocks>
   <payment>
     <rewrite>
        <form_container>Mynamespace_Module_Block_Form_Container</form_container>
   </rewrite>
  </payment>
 </blocks>
</global>

I have then, in my Module, Mynamespace/Module/Block/Form/Container.php

<?php

class Mynamespace_Module_Block_Form_Container extends Mage_Core_Block_Template
{
  protected function _prepareLayout()
  {
    echo "hello world";
  }
}

none of the above solutions are working. it's still picking up the old block inside Mage/Payment/Block/Form/Container.php

Could it be because my module lives in local code pool??

0

Change this: <container_form>Mynamespace_Module_Block_Form_Container</container_form>

to this: <form_container>Mynamespace_Module_Block_Form_Container</form_container>

  • well, turns out it was a typo. it's form_container in my code. where else should i look into?? I've disabled the compilation and caching ( all sorts ). still, it picks up the old container block. – keaton016 Dec 3 '18 at 12:13
  • Another thing is: Mynamespace_Module_Block_Form_Container should extend Mage_Payment_Block_Form_Container, not Mage_Core_Block_Template. Do you have any other extensions that rewrite that block? You can check conflicts using the Firegento_Debugmodule – simonthesorcerer Dec 3 '18 at 13:28

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.