Jump to content

[SOLVED] wrong delivery address details in back office and email order confirmation


Recommended Posts

Hi,

 

I hope someone could help me and point me to the right direction,

 

I am using one page checkout of ps 1.5.0.17. I noticed that in the default one page checkout, in the new customer field (new registration), the first name and last name after email address and password are being automatically copied to the first and last name fields in Delivery address (just below new customer). Now logically, the customer will change the first and last name in the delivery address fields to the name of their recipient, and so to say complete the form with the details of their recipient. And continue to create an invoice address with the name and details of themselves (sender). And this should be the right process if I am not mistaken.

 

The problem of doing this process:

1. After doing the above steps and save the registration, when the page refreshes and shows the addresses. The delivery address shows the name of the sender but has the address filled in the delivery address area of the registration form. And the billing address also shows the name of the sender and has the address filled in the invoice address area of the registration form. Therefore the name of the recipient is missing (and this is the name from the Delivery address of the reg. form)

 

2. To replicate the issue and try to look for a fix: In the new customer registration,

a. I used senders email address

b. Sender’s password

c. Recipient first name (this time to check if it will be show properly in the addresses page)

d. Recipient last name

e. In the delivery address area, the first and last name of the recipient has already been automatically filled. So I just finished the delivery form with the rest of the recipient’s details.

f. I continued the registration by filling up the invoice address form with the details of the sender.

g. After saving the registration and the page reloads to addresses page, the delivery address now shows the complete billing address details, and the billing address shows the complete delivery address details. The only problem now are:

g1. The details are being shown in the wrong address areas or being shown under the wrong address title.

g2. The user info in the header shown that the account is under the recipient name since we used the recipients’ fname and lname in the new customer area to fix the details in the addresses page.

 

3. The fix I created to properly assign the correct details to their respective areas are this (this is what I thought logically the right fix) :

A. I edited order-opc-new-account.tpl (themes/order-opc-new-account.tpl)

a1. Under New Customer change the following:

- Email to Sender Email

- Password to Sender Password

- First Name to Sender First Name

- Last Name to Sender Last Name

This is to make sure that the account would be under the sender per user info in the header, and that the billing / invoice address will show the correct name.

 

B. Under h3 heading "Delivery address":

- Change the heading title from ‘Delivery address’ to ‘Sender Information Billing Address’

This is to make sure that details in the new customer fields especially first and last names will correspond with this fields properly since fname and lname are being copied automatically from above fileds. And it seems that the system is using the fname and lname of this area as well the new customer area to show the correct details in addresses page.

- Delete First Name label (no use anymore because the field is being filled automatically)

- Hide First Name input type (no use anymore because the field is being filled automatically)

- Delete Last Name label (no use anymore because the field is being filled automatically)

- Hide Last Name input type (no use anymore because the field is being filled automatically)

 

C. Change invoice_address checkbox title to "PLEASE CHECK BOX TO CREATE YOUR DELIVERY ADDRESS". To make sure that user will not be misled.

 

D. Under h3 heading "Invoice address":

- Change the heading title from ‘Invoice address’ to ‘Recipient Information Delivery Address’

- Change label of First Name to Recipient First Name

- Change label of Last Name to Recipient Last Name

To above changes from A – D, is to make sure that the user information will be properly pointed to the sender’s name. To continue with the fix.

 

E. I edited order-address.tpl (themes/order-address.tpl)

- In about line 103 change the value of get address titles function. Basically I just swapped the address tiles:

'invoice': "{l s='Your billing address'}", to 'invoice': "{l s='Your delivery address'}",

'delivery': "{l s='Your delivery address'}" to 'delivery': "{l s='Your billing address'}"

 

This is to make sure that the recipient and sender details will be shown the correct address areas and details or address title. And it works!

 

The only problem now is, I noticed that after placing a successful order:

1. in BO (orders) and in my email order confirmation, delivery address is showing the exact details of the billing address including the sender's name.

- Checking the order in back office, it shows that the delivery address details created during registration has been saved, because it is available in the dropdown menu of shipping address. But was not being used by the system.

 

The question now is what can be the fix for this problem? Sorry for the long story but has a tiny problem and a short question.

 

Thanks very much

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

Modifying the OPC as Billing/Invoice First Followed by Delivery in New Customer Registration:

 

The default layout of the form is:

1. Account

1.a already registered box

1.b. new customer box

1.c delivery box containing all the fields

1.d checkbox to open invoice box

1.e invoice box containing all the fields

1.f customer data privacy

1.g save button

 

In the above layout the default process is, whatever you fill in the first and last name in the new customer box, it will be automatically be copied to the delivery box's first and last name. And if you used the sender's name (this is supposed to be found in the invoice box) to fill the first and last name of the new customer box then changed the first and lat name of the automatically filled first and last name in the delivery box to recipient name, after registration only sender's name will be saved the recipient name from the delivery box is gone.

 

But if you will use the recipient name in the first and last name in the new customer box, the recipient name will be used as the customer information in the user login, showing the name of the recipient as the customer name (so annoying). This experience could may only have been because of a bug on my part. But what i did was i reversed everything so everything would be clearer and straightforward.

 

the Fix:

1. Edit your themes/yourthemename/order-opc-new-account.tpl

 

A. Delivery Box

 

- In about line 31 in the h3 tag saying New Customer, changed it to 'Sender Information (Billing Address)' or what ever you want to call it. And this box will be you invoice box. doing it this way will ensure that the sender name will be used as the customer user information, and will save your customers time in filling out the form because of confusion.

 

- In about line 112, change the (l s'Email') to (l s'Sender Email') *please be careful in using apostophee s in Sender it will read as another code.

 

- In about line 116, change the (l s'Password') to Sender Password

 

- In about line 128, change instance from First Name to Sender First Name

 

- In about line 132, change instance from Last Name to Sender Last Name

 

-In about line 179 delete the h3 tag saying Delivery Address (remember we are modifying address box to become the invoice box)

 

- In about line 189, removed the lable for first name

 

- In about line 190 hide the input type instance from "text" to "hidden"

 

- In about line 194 delete the lable for last name

 

- In about line 195 hide the input type instance from "text" to "hidden"

 

The rest of the fields are ok.....

 

Note: if you are using an active carriers for your shipping you have to change the state field instance in your delivery box:

 

- In about line 235 and 252 change this

 

 

<p class="required id_state select" style="display:none;">

<label for="id_state">{l s='State'} <sup>*</sup></label>

<select name="id_state" id="id_state">

<option value="">-</option>

</select>

</p>

 

to this

 

 

<p class="required id_state_invoice select" style="display:none;">

<label for="id_state">{l s='State'} <sup>*</sup></label>

<select name="id_state_invoice" id="id_state_invoice">

<option value="">-</option>

</select>

</p>

 

there are 2 state field instances, make sire to change both.

 

Reason for this is to make the state field in your delivery box being read as field from invoice box.

 

B. Invoice Box

 

- In abut line include this : checked="checked" in the checkbox inout type right adter the id="invoice_address"

 

this will automatically check the checkbox to show the invoice box (now will become the delivery box), also pleae make sure to change the label title to whatever you want to call it.

 

- In about line 284, change the h3 tag from Invoice Address to 'Recipient Information (Delivery Address)' or whatever you want

 

- In about line 305, change instance from 'First Name' to {l s='Recipient First name'} or your own equivalent

 

- In about line 310, change instance from 'last Name" to {l s='Recipient Last name'} or your own equivalent

 

 

 

Note: if you are using an active carriers for your shipping you have to change the state field instance in your delivery box:

 

- In about line 345 and 354 change this

 

 

<p class="required id_state_invoice select" style="display:none;">

<label for="id_state">{l s='State'} <sup>*</sup></label>

<select name="id_state_invoice" id="id_state_invoice">

<option value="">-</option>

</select>

</p>

 

to this

 

 

<p class="required id_state select" style="display:none;">

<label for="id_state">{l s='State'} <sup>*</sup></label>

<select name="id_state" id="id_state">

<option value="">-</option>

</select>

</p>

 

there are 2 state field instances, make sire to change both.

 

Reason for this is to make the state field in your invoice box being read as field from delivery box, thus will ensure that your carrier(s) will work.

 

That's it for editing your themes/yourthename/order-opc-new-account,tpl

 

View your new form, if you like it let's proceed to the next step.

 

 

2. Edit your themes/yourthemename/order-address.tpl

 

- In about line 100 to 108 change the instance (get address titles)

 

From this:

 

 

function getAddressesTitles()

{

return {

'invoice': "{l s='Your billing address'}",

'delivery': "{l s='Your delivery address'}"

};

 

}

 

 

To this:

 

 

function getAddressesTitles()

{

return {

'invoice': "{l s='Your delivery address'}",

'delivery': "{l s='Your billing address'}"

};

 

}

 

 

- In about line 215, change the label instance

 

From this:

 

<label for="id_address_delivery">{if $cart->isVirtualCart()}{l s='Choose a billing address:'}{else}{l s='Choose a delivery address:'}{/if}</label>

 

To This:

 

<label for="id_address_delivery">{if $cart->isVirtualCart()}{l s='Choose a billing address:'}{else}{l s='Choose a billing address:'}{/if}</label>

 

 

- In about line 232, change the label instance

 

From this:

 

<label for="id_address_invoice" class="strong">{l s='Choose a billing address:'}</label>

 

To this:

 

<label for="id_address_invoice" class="strong">{l s='Choose a delivery address:'}</label>

 

 

And that's it enjoy the new functionality of your OPC, please be advised that this has been tested in PS 1.5 above. Make a proper back up of your files before you do this fix.

 

If your client's are having mixed or swapped addresses in their email order confirmation you may edit your mails/your_language/order_conf.html and swapped the instance in the address_block in delivery and billing .

 

Do the same if you are having swapped addresses details in your shop owner new order email confirmation in modules/mailalerts/mails/your_language/new_order.html

 

 

 

**************WARNING**************

This fix may have been very useful for me, try this at your own accord.

 

 

Thank you and hope this will help someone!.

Link to comment
Share on other sites

×
×
  • Create New...