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 9214447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:58:32+00:00 2026-06-18T01:58:32+00:00

after reading this tweet from Ivan Chepurnyi and having to add a step to

  • 0

after reading this tweet from Ivan Chepurnyi and having to add a step to the OnePage Checkout (aka OPC) for a client’s site, I thaught it was the perfect occasion to learn something new.
I am a big fan of events/observers and try to use them as much as possible, but precisely for the OPC so far I found that it was not very elegant to use them. I mean, there are no useful events (as far as I know) that can be used.

For example, from the top of my head I think of 2 things that I have to change and are very easy with a rewrite while it would be over complicated with event/observer:

  1. steps: Mage_Checkout_Block_Onepage::getSteps() defines the different steps that composes the OPC. I really can’t see what event would allow me to change that
  2. goto: when one step is completed the Mage_Checkout_OnepageController‘s corresponding action returns the html for next step along with the goto_section and update_section data. Again, I don’t see any interesting event

And this is just without really looking into every detail I’ll have to implement, I guess there are more pitfalls.
Same thing for the javascript part: I am used to extend the checkout js class:

var MyModule = Class.create(Checkout, {
    //write some code here
});

but I wonder if there is a better way.

I realize that Ivan’s tweet is meant for PSP devs, and that I am working for a final client, but I’d like to learn something new

  • 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-18T01:58:33+00:00Added an answer on June 18, 2026 at 1:58 am

    Main idea of the tweet was about most of the developers who develop custom payment methods don’t care about conflicts with other modules or customizations you have on the website.

    Onepage Checkout Steps

    As for your first step, it is a problem of Magento core, that it has all checkout steps in _getSteps() method are hardcoded and you cannot change it without override.

    Controller Overrides

    The second one is quite easy to implement even with just using of controller_action_predispatch and controller_action_postdispatch actions.

    On preDispatch Magento gives you a lot of freedom to control the flow of controller action by using controller flags like FLAG_NO_DISPATCH, FLAG_NO_PRE_DISPATCH and FLAG_NO_POST_DISPATCH.

    On postDispatch you can modify existent result by modifying body of the response object. In case of returned JSON, you can easily transform this data back to array, modify it and set back as JSON.

    Yes this solution might more complex to implement, but it increases your module compatibility with the others a lot, since you are safe with possible overrides of the same controller by other module.

    JavaScript Customizations

    As for JavaScript, you should always consider that it is dynamic language and there is no class itself on language level, everything is an object and you are always can extend existing functionality via replacing existing object prototype with own implementation by using assignment of variables:

    window.Checkout = Class.create(Checkout, {
          someMethod: ($super, param1, param2) {
              // Do you custom staff before
              $super(param1, param2);
              // Do you custom staff after
          }
    });
    

    In the following example prototype of Checkout “class” is gets replaced by your instance, that customizes its someMethod functionality. $super variable contains Function object of parent “method”, that gets overwritten and it will work with the same kind of customization to the same class of another method (or even the same one), because it just modifies only property that contains that method definition.

    If you’d like to read more about this JS language functions please refer to this website: http://www.crockford.com/javascript/javascript.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading this article, it makes sense to rebase to gather changes from the
After reading this: Code for download video from Youtube on Java, Android I found
I am coming back from after reading this c-faq question I am totaly confused
After reading this post (recommended reading) about not using HTML5Shiv direct from source like
After reading this question regarding Linux: Open Terminal From Eclipse I have the same
After reading this answer: best way to pick a random subset from a collection?
After reading this question, I need to clear up some things. IQueryable<Customer> custs =
After reading this article I don't have a clear answer: http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/ Will browsers interpret
After reading this post I kinda felt in the same position as the guy
After reading this article on thedailywtf.com, I'm not sure that I really got the

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.