Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - What is the code for Address line 2?

Tags:

magento

For whatever reason, the second address line is missing in my Magento store but I've noticed it active in other stores. Can someone please copy and past what they have for their 2nd address line in the following files:

  • template/customer/address/edit.phtml
  • template/checkout/onepage/shipping.phtml
  • template/checkout/onepage/billing.phtml

Below is an example of what I have for the first street line, but I need to add in the second street line. Also, will there be anything I'll need to change to make this work? I suspect that the core functionality is still there, it's just not appearing on the front end.

<li class="wide">
   <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
   <div class="input-box">
      <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
   </div>
</li>
like image 565
Nick Avatar asked Apr 25 '11 21:04

Nick


People also ask

How can I get billing address in Magento 2?

Call a required function in the template file, You need to pass Order id to below function. Using Order Id we can get Customer billing and shipping address id and based on respective id we can get billing and shipping address.


1 Answers

If you have access to the address object, you can easily get each street line with:

$address->getStreet(1);
$address->getStreet(2);
like image 167
Prattski Avatar answered Sep 26 '22 03:09

Prattski