I'm having problems redefining the main controller. I want to add a new function, but it only works if I do it in the main file (code / core / checkout / controllers / onepagecontroller.php).
I went for some message, but it does not work. Some of them:
(I can not add more links, sorry)
I do not know what is happening ... maybe you can help me;).
I am using magento 1.5 and I have these 3 files:
local -> Arias -> CoreExtended -> etc -> config.xml
<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Arias_CoreExtended> <version>0.1.0</version> </Arias_CoreExtended> </modules> <frontend> <routers> <checkout> <args> <modules> <Arias_CoreExtended before="Mage_Checkout">Arias_CoreExtended_Checkout</Arias_CoreExtended> </modules> </args> </checkout> </routers> </frontend> </config>
app → etc → modules → Arias_CoreExtended.xml
<?xml version="1.0"?> <config> <modules> <Arias_CoreExtended> <active>true</active> <codepool>local</codepool> </Arias_CoreExtended> </modules> </config>
local → Arias → CoreExtended → controllers → Checkout → OnepageController.php
<?php require_once 'Mage/Checkout/controllers/OnepageController.php'; class Arias_CoreExtended_Checkout_OnepageController extends Mage_Checkout_OnepageController { public function collectAction() { echo 'WTF?'; } public function indexAction() { echo "This controller has been overridden."; } }
Thanks in advance for your time.
source share