I'm aiming to override the class Mage_Checkout_Block_Onepage in order to begin a rework of the onepage checkout. Unfortunately, i fail to success at overriding it, while the onePageController override works fine. My package name is Ohwee, my extension name is ThirdStepsCheckout.
Files in my extension:
Checkout/ Block/ Onepage.php controllers/ OnepageController.php etc/ config.xml Here's my config.xml file :
<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Ohwee_ThirdStepsCheckout> <version>0.1.0</version> </Ohwee_ThirdStepsCheckout> </modules> <global> <blocks> <checkout> <rewrite> <onepage> Ohwee_ThirdStepsCheckout_Block_Onepage </onepage> </rewrite> </checkout> </blocks> </global> <frontend> <routers> <checkout> <args> <modules> <ohwee_thirdstepscheckout before="Mage_Checkout">Ohwee_ThirdStepsCheckout</ohwee_thirdstepscheckout> </modules> </args> </checkout> </routers> </frontend> </config> at the time, the block class Onepage.php is just a test to see if the override is working :
<?php require_once 'Mage/Checkout/Block/Onepage.php'; class Ohwee_ThirdStepsCheckout_Block_Onepage extends Mage_Checkout_Block_Onepage { public function getSteps() { exit('custom steps'); } } ?> The problem is I don't see the exit on front, but the layout is now empty, so it seems the original Mage controller isn't called either. If i delete the config.xml part about overriding the block, checkout is functional again. I can't see from where the issue come from,any ideas ?
I'm on Magento CE 1.8.0.1