Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7818795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:42:03+00:00 2026-06-02T06:42:03+00:00

I try to overwrite 2 controllers in one module. These are both Checkout controllers.

  • 0

I try to overwrite 2 controllers in one module. These are both Checkout controllers.
– OnepageController
– CartController

My cart controller works. But mine onepage controller does not overwrite. Can it be that you can not overwrite 2 files?

My files:

WP/Ajaxcart/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
       <WP_Ajaxcart>
           <version>0.1.0</version>
       </WP_Ajaxcart>
    </modules>
    <frontend>
        <routers>
            <checkout>
                <use>standard</use>
                <args>
                    <modules>
                        <WP_Ajaxcart before="Mage_Checkout">WP_Ajaxcart</WP_Ajaxcart>
                    </modules>
                </args>
            </checkout>
        </routers>
    </frontend>
</config>

WP/Ajaxcart/controllers/OnepageController.php

<?php

require_once "Mage/Checkout/controllers/OnepageController.php";
class WP_Ajaxcart_Checkout_OnepageController extends Mage_Checkout_OnepageController
{

    public function successAction()
    {

        $session = $this->getOnepage()->getCheckout();

        if (!$session->getLastSuccessQuoteId()) {
           $this->_redirect('checkout/cart');
            return;
        }

        $lastQuoteId = $session->getLastQuoteId();
        $lastOrderId = $session->getLastOrderId();
        $lastRecurringProfiles = $session->getLastRecurringProfileIds();
        if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {
            $this->_redirect('checkout/cart');
            return;
        }
        echo 'Do something else';
        //$session->clear();
        $this->loadLayout();
        $this->_initLayoutMessages('checkout/session');
        Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
        $this->renderLayout();
    }

}

WP/Ajaxcart/controllers/CartController.php

<?php

require_once "Mage/Checkout/controllers/CartController.php";
class WP_Ajaxcart_Checkout_CartController extends Mage_Checkout_CartController
{

    public function addAction()
    {
        echo 'test';
    }

}

I has someone any idea what doing wrong why it’s not overwriting the OnepageController.php.

Thank you.

Lex

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:42:08+00:00Added an answer on June 2, 2026 at 6:42 am

    try

    <WP_Ajaxcart_Checkout before="Mage_Checkout">WP_Ajaxcart_Checkout</WP_Ajaxcart_Checkout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up a folder with a controller in it: controllers/admin/home.php , but
When I try to decompress my .gz file and overwrite the db file I
I've been trying to override the file login.xml but no matter what I try,
I added the controller's container to the layout. When I try to call the
I have one controller that takes a username and pass and checks against a
I'm trying to create a multiview controller for a game, in which one root
Thread thread = new Thread(new Runnable() { @Override public void run() { try {
I want to override the SubmitChanges() method for my model. Whern I try to
this is my thread: @Override public void run() { Log.d(ConnectionThread,Starting Server Connection); try {
Try executing the following in JavaScript: parseInt('01'); //equals 1 parseInt('02'); //equals 2 parseInt('03'); //equals

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.