views:

41

answers:

2

Hi, I need to call a variable that is a customer’s shipping address attribute, in Onepage checkout, step 3 shipping method

In file

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

I already made successful tests in calling this variable with :

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

in

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

and in

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

But I can’t call this variable in deliverydate.phtml that is called in onepage/shipping_method.phtml with php echo $this->getChildHtml('deliverydate')

How can I do that ? Make $numero_point_relais as global ? How ? Make a module ? Or is there an easier method ?

Thanks for your answer

A: 

I get it eventually : $numero_point_relais = Mage::getSingleton('customer/session')->getCustomer()->getPrimaryShippingAddress()->getNumpr()

Bargalunan
A: 

the variable $numero_point_relais is not define in deliverydate.php; you can set customer Object follow:

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

mivec