Jump to content

Address2 not showing


zapmore

Recommended Posts

Hello,

 

I've been looking for hours and searching trough all the prestashop files and can't get the adress2 field in guest checkout to show.

 

When looking at the code in firebug, it gives me:

 

 

element.style {

  • display: none;

}

 

Code:

<p class="text is_customer_param" style="display: none;"> <label for="address2">Adress (Rad 2)</label> <input type="text" class="text" name="address2" id="address2" value=""></p>

 

Where do I change this to show? Need this as a Care of (c/o) address field...

Link to comment
Share on other sites

Hi zapmore,

Not sure for guests, but normally addresses are country dependent, and this can this be defined there.

 

Go to localization->Countries edit the country you are shipping to, and add the address2 line:

- Press Enter at end of Address1 to create an empty line

- then click on 'address' on the right of the address block. Some green address parts are shown, one of them being address2.

- Click on this to add it to the address for that country.

- Save and check.

(Maybe empty cache of your browser to make it work)

 

My 2 cents,

pascal

Link to comment
Share on other sites

Hi zapmore,

Not sure for guests, but normally addresses are country dependent, and this can this be defined there.

 

Go to localization->Countries edit the country you are shipping to, and add the address2 line:

- Press Enter at end of Address1 to create an empty line

- then click on 'address' on the right of the address block. Some green address parts are shown, one of them being address2.

- Click on this to add it to the address for that country.

- Save and check.

(Maybe empty cache of your browser to make it work)

 

My 2 cents,

pascal

 

Thank you for your input. I followed your instructions, and everything seems right in that section:

firstname lastname

company

vat_number

address1

address2

postcode city

Country:name

phone

 

I cleared the cache and tried different browsers, still not working...

 

BTW VAT_number is not showing either, and I want to keep it that way.

Edited by zapmore (see edit history)
Link to comment
Share on other sites

Hi zap,

Can you try out something for me? Can you edit the country United States, and see if that country has an address2 and a vat_number?

If so/not, take out the vat_number here, and add the address2 line as needed.

Save and check one more time if this has any effect.

 

My 2 (guessing) cents,

pascal

Link to comment
Share on other sites

  • 2 months later...

Not sure whether this reply is too late but I've noticed the same problem, i.e. that "Address (Line 2)" does not show up in the guest checkout, though it does if you go to create an account. This is Prestashop 1.5.6, set up for UK (and "address2" is definitely in the address format for the country).

 

Part of the reason is that in the tpl files (theme\order-opc-new-account.tpl) the address 2 input field and label are enclosed within a <p> tag which has the class "is_customer_param" and the Javascript associated with the page (theme\js\order-opc.js) is hiding all fields of that class. Removing the "is_customer_param" class from the <p> tag does make the Address 2 input field show up - however, any data entered into it is not saved in the database (and neither is the gender setting as it happens). One clue is in controllers\front\OrderOpcController.php, line 423 - there's an array filled with various address fields, address1 is there but address2 is not.

 

So, there must be some reason why the designers decided that Address 2 was not wanted for a guest address - I can't imagine why :-(.

 

Dave.

Edited by Dave Riley (see edit history)
Link to comment
Share on other sites

  • 4 months later...
  • 2 weeks later...

 

So, there must be some reason why the designers decided that Address 2 was not wanted for a guest address - I can't imagine why :-(.

 

Dave.

 

Hi,

 

They wanted this form as short as possible, like just on phone, not repeating lastname for the adress etcetc.  They wanted this guest checkout as fast as possible. Removing this is_customer_param class should display the field depending on checkout process, either in authentication.tpl or order-opc-new-account.tpl I believe.

 

Regards

Link to comment
Share on other sites

Hi Gregory,

Removing the is_customer_param class will indeed cause address 2 to be displayed however anything typed into it will still not be saved to the database. To do that it's necessary, I think, to modify the code in controllers\front\OrderOpcController.php.

 

Hopefully the ticket that David Georges has raised (thanks David!) will see this corrected eventually.

 

Regards,

Dave

  • Like 1
Link to comment
Share on other sites

Hi again,

I did try (some months ago now) removing the is_customer_param class and Address 2 was displayed in the guest checkout but, as I said, anything typed into it wasn't saved. Perhaps I'm wrong but in OrderOpcController.php, line 425 in V1.6, function _getGuestInformations(), there is an array of database fields - it includes address1 but not address2. I didn't try it but I assumed that this was the reason the data was not saved. At the time I decided to give up and leave it as it was, it's an irritation rather than a serious bug.

 

Regards,

 Dave

Link to comment
Share on other sites

  • 1 year later...

Hi,

 

They wanted this form as short as possible, like just on phone, not repeating lastname for the adress etcetc.  They wanted this guest checkout as fast as possible. Removing this is_customer_param class should display the field depending on checkout process, either in authentication.tpl or order-opc-new-account.tpl I believe.

 

Regards

 

The lack of this second address line makes order processing longer, in fact, because you have to contact the customer to ask what their apartment number is when you try to ship their order and USPS says that the delivery address is incomplete. Been there many, many times. Then I have to wait for the customer to reply for days sometimes before I can ship out their order. It takes seconds to enter your apartment number and there must be a field for customers to enter their complete address.

Link to comment
Share on other sites

  • 10 months later...

Prestashop 1.6

 

Another possibility, if you are using the Guest Checkout, into authencation.tpl the adress2 field contains :

{elseif $field_name eq "address2"}
                                                        <div class="form-group is_customer_param">

And actually into vi js/order-opc.js there's this :

                else if (isGuest)
                {
                        $('.is_customer_param').hide();
                        $('#opc_account_form').show('slow');
                        $('#is_new_customer').val('0');
                        $('#opc_account_choice, #opc_invoice_address').hide();
                        $('#new_account_title').html(txtInstantCheckout);
                }

Then just remove "is_customer_param" from the class of <div>

Edited by akelwood (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...