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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:45:59+00:00 2026-05-28T02:45:59+00:00

I am implementing my own payment module for Magento, where I implemented getCheckoutRedirectUrl() method

  • 0

I am implementing my own payment module for Magento, where I implemented getCheckoutRedirectUrl() method in my payment model.

class My_Module_Model_Payment extends Mage_Payment_Model_Method_Abstract {}

This method is supposed to just return URL of payment gateway where user is redirected to, but I should also append current orderId to this URL.

The problem is am not able to get orderId. I tried solution as already accepted here

$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();

but I get empty $orderId. So this doesn’t seem to work in my method. The call doesn’t produce error, so I get an object (for example Mage::getSingleton(‘checkout/session’)->getQuote()->getSubtotal() returns order amount), but orderId is empty.

I also tried:

$order = Mage::getModel('sales/order');
$order->load(Mage::getSingleton('sales/order')->getLastOrderId());
$orderId = $order->getIncrementId();

which again returns empty $orderId.

Any Ideas?

  • 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-05-28T02:46:00+00:00Added an answer on May 28, 2026 at 2:46 am

    Your question, as written, is illogical.

    There is no order id during checkout. While you’re checking out, Magento creates a sales/quote object. This object is used to keep track of quote items. It’s not until checkout is complete that a sales/order object is created from the quote.

    The reason getLastOrderId is returning empty is because no order has been placed.

    Restating your question with the point in the checkout process that you’re at, and what you’re trying to do with the order id may help someone come up with the piece of information that you don’t know you need.

    Good luck!


    Author’s solution:

    The problem was solved by first getting quote ID from checkout/session:

    Mage::getSingleton('checkout/session')->getQuoteId(); 
    

    and then quote object by quote ID:

    $quote = Mage::getModel("sales/quote")->load($quoteId); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I meet this problem when implementing my own swap() method with Python def swap(a,b):
I am implementing my own enumerable type. Something ressembling this: public class LineReaderEnumerable :
I was implementing my own ArrayList class and was left surprised when I realised
Basically, I am implementing own cache system. Ideally, it'll look like this: $CACHE->start($name); //CODE
I am implementing my own Java class for sorting a List<T> in eclipse. I
I am implementing my own linked list in Java. The node class merely has
I'm implementing my own matrix class in c++ to help me develop my understanding
I'm implementing my own named pipe Client/Server class, but I'm getting too much troubles
I'm implementing my own BigNumber class in C# for educational purposes. For a start,
Is there a native way (preferably without implementing your own method) to check that

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.