【问题标题】:Magento : call a variable from customer’s shipping address in Onepage checkout, step 3 shipping methodMagento :在 Onepage 结帐中从客户的送货地址调用变量,第 3 步送货方式
【发布时间】:2010-07-02 20:38:41
【问题描述】:

我需要调用一个变量,它是客户的送货地址属性,在 Onepage 结帐,第 3 步送货方式

在文件中

app/design/frontend/default/default/template/deliverydate/onepage/deliverydate.phtml

我已经成功测试了调用这个变量:

$numero_point_relais = $this->getCustomer()->getPrimaryShippingAddress()->getNumpr();    

app/design/frontend/default/default/template/checkout/onepage/shipping.phtml

app/design/frontend/default/default/template/dull/addressfields/onepage/shipping.phtml

但是我不能在一个页面/shipping_method.phtml 中调用的deliverydate.phtml 中调用这个变量 php echo $this->getChildHtml('deliverydate')

我该怎么做? 将 $numero_point_relais 设为全局?如何 ? 做一个模块?还是有更简单的方法?

感谢您的回答

【问题讨论】:

    标签: magento variables shipping street-address


    【解决方案1】:

    我最终明白了: $numero_point_relais = Mage::getSingleton('customer/session')->getCustomer()->getPrimaryShippingAddress()->getNumpr()

    【讨论】:

      【解决方案2】:

      变量$numero_point_relais 没有在deliverydate.php 中定义; 您可以设置客户对象如下:

      $variable = Mage::getModel('customer/session');

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-10-25
        • 2021-10-10
        • 2013-02-28
        • 1970-01-01
        • 2012-09-27
        • 1970-01-01
        • 2021-04-19
        • 1970-01-01
        相关资源
        最近更新 更多