简体   繁体   English

在发货步骤(从结算步骤)获得“名字”。 Magento 1.7结帐

[英]Get “firstname” in shipping step, from billing step. Magento 1.7 checkout

This question is regarding Magento 1.7 - Onepage Checkout. 这个问题与Magento 1.7-单页签出有关。

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. 我想在发货信息-步骤期间使用它,将其设置为字段“ firstname”的默认值。

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. 我需要的是将帐单步骤中firstname字段中的值过帐到运输步骤中。

Any ideas? 有任何想法吗?

// Thanks guys :) // 多谢你们 :)

Try this: 尝试这个:

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

I think it'll work for you. 我认为它将为您工作。

试试这个也许:

$checkout = Mage::getSingleton('checkout/type_onepage')->getQuote();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM