문제

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 :)

도움이 되었습니까?

해결책

Try this:

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

I think it'll work for you.

다른 팁

try this maybe:

$checkout = Mage::getSingleton('checkout/type_onepage')->getQuote();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top