Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to get shipping address and billing address in checkout/onepage/sucess? 
 
reyewatb
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2010-02-23
 

How to get shipping address and billing address in checkout/onepage/sucess?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

$lastOrder Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
$billingAddress $lastOrder->getBillingAdress();
$shippingAddress $lastOrder->getShippingAdress();
 
Magento Community Magento Community
Magento Community
Magento Community
 
reyewatb
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2010-02-23
 

it does not work checkout/onepage/sucess confused

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

It worked for me. In what file did you put the code?

 
Magento Community Magento Community
Magento Community
Magento Community
 
reyewatb
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2010-02-23
 

i created a block and hooked it in checkout/onepage/sucess

in my local.xml
<checkout_onepage_success>
<reference name="content">
<block type="reyewat_preflight/view" name="checkout.view" template="preflight/view.phtml" before="-"></block>
</reference>
</checkout_onepage_success>

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

I never tried this. I used it directly in the success block.

 
Magento Community Magento Community
Magento Community
Magento Community
 
reyewatb
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2010-02-23
 

i do not want to add it to my success block because someday i might decide to update my store to the latest version of magento. oh oh

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

You can overwrite the success block and still upgrade later
http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/

Off topic: Nice avatar smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
bmotters
Member
 
Total Posts:  46
Joined:  2009-04-16
 
reyewatb - 04 March 2010 01:36 AM

i created a block and hooked it in checkout/onepage/sucess

in my local.xml
<checkout_onepage_success>
<reference name="content">
<block type="reyewat_preflight/view" name="checkout.view" template="preflight/view.phtml" before="-"></block>
</reference>
</checkout_onepage_success>

This won’t work.  local.xml is a config XML not a layout XML.  All the config XML files are essentially merged into one configuration.  And all the layout XML files are essentially merged into one set of layout definitions potentially contributing to the layout handles for the layout.  But the config and the layout XML are not merged into one.  You cannot put config into a layout file or vice-versa.

Try putting your definitions in one of the layout files for your theme.  It is hard to say if it will work, because we don’t know what the code of your block or your template does.  But putting the layout handle and the block definition in local.xml definitely won’t work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
reyewatb
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2010-02-23
 

i meant layout rasberry am sorry

 
Magento Community Magento Community
Magento Community
Magento Community
 
reyewatb
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2010-02-23
 

To tzyganu, i checked the url http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/ , its says OVERIDING CORE NOT MODIFYING CORE . you said you added your code to success.php. you did not mention about overiding.i believe hooking my block to the success page was a much easier thing to do.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cubix WS
Guru
 
Avatar
Total Posts:  318
Joined:  2009-07-01
LondON, United Kingdom
 

Are you sure the block is being called in the first place?

 
Magento Community Magento Community
Magento Community
Magento Community
 
pkimatt
Jr. Member
 
Total Posts:  8
Joined:  2010-07-14
 
tzyganu - 03 March 2010 04:19 AM

$lastOrder Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
$billingAddress $lastOrder->getBillingAdress();
$shippingAddress $lastOrder->getShippingAdress();

Typo in your code, that could be the cause smile

getBillingAdress(); to getBillingAddress();

 
Magento Community Magento Community
Magento Community
Magento Community
 
velvet_grooves
Jr. Member
 
Total Posts:  10
Joined:  2011-03-30
 

Hi there,

My issue is the opposite to this, so I’m wondering if you might be able to help?

When I click on continue via “Billing Information”, it goes straight to the Shipping Method tab. I want it to go to the Shipping Information tab. Is there a way to resolve this?

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