Magento Forum

Error with Sucess page when refreshing page
 
Dan Orsborne
Member
 
Total Posts:  72
Joined:  2007-09-20
 

I think there is an error with the order sucess code that means you can’t refresh the order confirmation page. If you do you loose the order confirmation and get taken to a page that says ‘Sorry there are no items in your cart’.  I did a bit of digging and the following file: app\code\core\Mage\Checkout\controllers\OnepageController.php appears to have a mistake in it at line 33.  As you can see line 32 is commented, I can only assume that someone changed it to it’s current state from the version on line 32 but didn’t realise it stopped the thank you page working.

Can someone from Magento confirm this is correct and possibly include an update in the next version.  You need to change

if (!$this->getOnepage()->getQuote()->hasItems()) {
            $this
->setFlag(''self::FLAG_NO_DISPATCHtrue);
            
$this->_redirect('checkout/cart');
        
}

to

if (!$this->getOnepage()->getQuote()->hasItems() && $this->getRequest()->getActionName()!='success'{
            $this
->setFlag(''self::FLAG_NO_DISPATCHtrue);
            
$this->_redirect('checkout/cart');
        
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
YoavKutner
Guru
 
Avatar
Total Posts:  491
Joined:  2007-08-08
 

Dan - This is the way we intended for this to work. As you mentioned this was commented out, but this change was made by design. We feel that this is more secure way of having the success page, but you are more than welcome to make the change you have made.

Thanks.

yoav

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dan Orsborne
Member
 
Total Posts:  72
Joined:  2007-09-20
 

Ok, thanks. My only comment would be that it is usual to have a static order confirmation page that doesn’t disapear when you refresh. Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
finch8243
Sr. Member
 
Total Posts:  79
Joined:  2007-08-31
 

This brings up a new question though-- how do we test and style the checkout success page?  I’d like to make some changes to the default one, but I don’t want to checkout every time just to see it.  Any thoughts on how to get it so we can do some testing?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top