Magento Forum

   
How to show billing and shipping details on order review page
 
Creative_Glance
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2008-09-09
 

hi

I want to display billing and shipping address details on last step of one page checkout. I mean I want to show user’s selected billing and shipping address on ORDER Review page in ONEPAGE checkout.

I have try following code

$checkout Mage::getSingleton('checkout/session')->getQuote();
    
$billing $checkout->getBillingAddress();
    echo 
$billing->getName() . $billing->getStreet(1) . $billing->getPostcode() . $billing->getCity() . $billing->getCountry();

but it display default billing address only. i have 5 address in address book and i have selected 3rd address while selecting billing address. but above code only display default address

can anyone tell me whats the issue

thanks
Jimit

 
Magento Community Magento Community
Magento Community
Magento Community
 
jazkat
Sr. Member
 
Total Posts:  154
Joined:  2009-07-09
 

I know I’m few months too late, thought might still post the solution..

If you’re on the checkout page, then you already have the address id, so you use it to retrieve existing address:

$address Mage::getModel('customer/address')->load($customerAddressId);

// then retrieve address info 
echo $address->getData('firstname');

// other info you can get with getData is:
// prefix, middlename, lastname, suffix, company, city, region, postcode, telephone , fax

 
Magento Community Magento Community
Magento Community
Magento Community
 
sterlinggranger
Jr. Member
 
Total Posts:  2
Joined:  2010-04-14
 

Hello jazkat,

Can you tell us how to get $customerAddressId?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
yelo
Jr. Member
 
Total Posts:  11
Joined:  2010-04-02
 

here is how i did it

edit app/design/frontend/base/default/template/checkout/onepage/review/totals.phtml or the one in ur theme

$quote $this->getQuote();
$billingaddress $quote->getBillingAddress();
$shippingaddress $quote->getShippingAddress();
   
//billing
   
echo $billingaddress->getData("street") . " ";
   echo 
$billingaddress->getData("postcode") . " ";
   echo 
$billingaddress->getData("city") . " ";
   echo 
$billingaddress->getRegionCode();                                     
   echo 
$billingaddress->getCountry(); 
   
//shipping
   
echo $shippingAddress->getName();
   echo 
$shippingAddress->getData("company");
   echo 
$shippingAddress->getData("street");
   echo 
$shippingAddress->getData("postcode");
   echo 
$shippingAddress->getData("city");
   echo 
$shippingAddress->getRegionCode();
   echo 
$shippingAddress->getRegion();
   echo 
$shippingAddress->getCountry();
   echo 
$shippingAddress->getCountryModel()->getName();

 
Magento Community Magento Community
Magento Community
Magento Community
 
nagaraja.kharvi
Jr. Member
 
Total Posts:  7
Joined:  2010-12-15
 

Hi All,

I happy to assist you people.

please follow below steps to get progress bar on ‘order review’ block.

replace following (checkout.xml)::::::::::

<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">
<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
</block>

with:::::::::::

<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">

<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>

<block type="page/html_wrapper" name="checkout.progress.wrapper" as="checkout_progress">
<action method="setElementId"><value>checkout-progress-wrapper</value></action>
<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml"/>
</block>

</block>

and call this block on checkout/onepage/review.phtml::::::::::::::::::::::::::::::::::

<?php echo $this->getChildHtml('checkout_progress') ?>

Thats it.

yours nagaraja
work is my passion

 
Magento Community Magento Community
Magento Community
Magento Community
 
nagaraja.kharvi
Jr. Member
 
Total Posts:  7
Joined:  2010-12-15
 

and i noticed when implement above code ,right progress bar doesnot work.

so, please make neccessary chages in your theme skin/frontend/your theme/js/opcheckout.js

replace following attached code

File Attachments
opcheckout.js  (File Size: 31KB - Downloads: 243)
 
Magento Community Magento Community
Magento Community
Magento Community
 
nagaraja.kharvi
Jr. Member
 
Total Posts:  7
Joined:  2010-12-15
 

and i noticed when implement above code ,right progress bar doesnot work.

so, please make neccessary chages in your theme skin/frontend/your theme/js/opcheckout.js

replace following attached code

and in

checkout.xml

replace

following

<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">

<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>

<block type="page/html_wrapper" name="checkout.progress.wrapper.order" as="checkout_progress">
<action method="setElementId"><value>checkout-progress-wrapper-order</value></action>
<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml"/>
</block>

</block>

File Attachments
opcheckout.js  (File Size: 31KB - Downloads: 156)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Lakshyami
Member
 
Avatar
Total Posts:  44
Joined:  2010-03-25
Sri Lanka
 
nagaraja.kharvi - 15 December 2010 06:51 PM

Hi All,

I happy to assist you people.

please follow below steps to get progress bar on ‘order review’ block.

replace following (checkout.xml)::::::::::


<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">
<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
</block>

with:::::::::::

<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">

<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>

<block type="page/html_wrapper" name="checkout.progress.wrapper" as="checkout_progress">
<action method="setElementId"><value>checkout-progress-wrapper</value></action>
<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml"/>
</block>

</block>

and call this block on checkout/onepage/review.phtml::::::::::::::::::::::::::::::::::

<?php echo $this->getChildHtml('checkout_progress') ?>

Thats it.

yours nagaraja
work is my passion

Helped for me.. Thanks a lot. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
PowercutUK
Member
 
Avatar
Total Posts:  65
Joined:  2011-04-04
Carmarthen, Wales, UK
 

Hi all,

I managed to retrieve the customer address for a pre-filled in form when the customer logged in using this code:

<li class=\"fields\">
                <
div class=\"field\" style=\"position: relative; float: left; top: -350px\">
                <
label for=\"city\" class=\"required\"><em>*</em><?php echo Mage::helper(\'quickrfq\')->__(\'City/Town\'?></label>
                <
div class=\"input-box\">
                    <
input style=\"font-size:14px;\" name=\"city\" id=\"city\" title=\"<?php echo Mage::helper(\'quickrfq\')->__(\'City/Town:\') ?>\" value=\"<?php> $checkout = Mage::getSingleton(\'checkout/session\')->getQuote();
    
$billing = $checkout->getBillingAddress();
    echo 
$billing->getCity(); ?>\"  size=\"29\" type=\"text\" class=\"input-text required-entry\"/>
                </
div>
                </
div>
            </
li>

However, for some reason (I hope you can help) this information is not showing today. When I took the code out of the input-box and just tried to recall it normally, it is showing \"Array\"

I\’m stuck with this one, \"Array\" is showing a few other pages as well. Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
rajanrufus
Jr. Member
 
Total Posts:  6
Joined:  2011-11-17
 

Thanks for sharing. Its really useful for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
loeffel
Guru
 
Avatar
Total Posts:  427
Joined:  2009-02-03
 

The method nagaraja.kharvi posted is working (Magento 1.5.1.0) for everything except payment method. For some reason it can not pull the payment information. Has anybody managed to fix that?

EDIT:
I was able to retrieve it with:
Mage::getSingleton(’checkout/session’)->getQuote()->getPayment()->getMethodInstance()->getTitle();

 
Magento Community Magento Community
Magento Community
Magento Community
 
hkpatel201
Jr. Member
 
Total Posts:  25
Joined:  2013-03-31
 

Check here.
http://hkpatel201.blogspot.in/2013/04/change-shipping-address-dropdown-at.html

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