I'm using paypal standard as a payment system and want to get the last order id and for that I'm using age::getSingleton('checkout/session') ->getLastRealOrderId();
But this is not giving me the last placed order ID., I've checked in the modal app/code/local/Mage/Paypal/Model/ipn.php
in method _registerPaymentCapture
I've tried saving the order into a session so that I can get it on success page…but that is also not working.
Any help is much appreciated.
Best Answer
ravi,there place where this session is place
First ,
this session variable
isset
atMage_Checkout_Model_Type_Onepage
on functionsaveOrder
here thussession variable is set for first time
before redirecting to paygate way.For Paypal,if customer
is cancel this payment at paypal site
and comesto magento paypal cancel url then on cancelAction
this session variable is destroyed
.So,you do not getrealorderid
.beacuse using ->unsLastOrderId() destroy realorderid .Check at