Question

This question is regarding Magento 1.7 - Onepage Checkout.

I want to retrive the firstname value, that the user has given in the billling information - step.

I want to use it, to set it as the default value, for the field "firstname", during the shipping information - step.

I have tried a lot of the given examples in this site. The closest one i came across was these lines of code:

$checkout = Mage::getSingleton('checkout/session')->getQuote();
$billing = $checkout->getBillingAddress();
echo $billing->getName();

However this retrives the user in session, so I am always getting the user information from the "last/previous" order.

What i need, is to post, the value from the firstname field in the billing step, to the shipping step.

Any ideas?

// Thanks guys :)

Was it helpful?

Solution

Try this:

$first_name = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getFirstname();

I think it'll work for you.

OTHER TIPS

try this maybe:

$checkout = Mage::getSingleton('checkout/type_onepage')->getQuote();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top