Jump to content

Billing and delivery addresses different by default


Recommended Posts

I need to have the billing and delivery addresses different by default because my customers rarely send gifts to themselves. If the delivery and the billing addresses are the same then they have to click the box, otherwise they need to add an address for delivery.
I can't believe how many of my visitors have complained about setting this up being a pain.....looks easy to me!
Anyway, what do I need to change in the php file to make this happen?



{l s='Choose a delivery address:'}

{foreach from=$addresses key=k item=address}
id_address_delivery}selected="selected"{/if}>{$address.alias|escape:'htmlall':'UTF-8'}
{/foreach}



<input type="checkbox" name="same" id="addressesAreEquals" value="1">id_address_invoice == $cart->id_address_delivery || $addresses|@count == 1}checked="checked"{/if} />
{l s='Use the same address for billing.'}




I know this is the area, but not sure what to change and where.

Thank you so much!!
Link to comment
Share on other sites

Anyone please? how do i make the "billing and delivery" box unchecked by default?


Go to themes/your_themes/order-address.tpl, somewhere in line 32,

<input type="checkbox" name="same" id="addressesAreEquals" value="1"

change it to

<input type="checkbox" name="same" id="addressesAreEquals" value="0"
Link to comment
Share on other sites

I did that but it didn't work. Perhaps I should change something else too?


Oh, sorry. The thread ate half of the codes.

form

<input type="checkbox" name="same" id="addressesAreEquals" value="1">id_address_invoice == $cart->id_address_delivery}checked="checked"{/if} />

to


<input type="checkbox" name="same" id="addressesAreEquals" value="0">id_address_invoice > $cart->id_address_delivery}checked="checked"{/if} />

I think it will work.
Link to comment
Share on other sites

  • 4 weeks later...
Perhaps you can be inspired by my demo-shop. Users don't login and there are fewer steps in the checkout. You could easily change the "Use the same address" checkbox to be unchecked per default.

/Kjeld


Your check out has problem. If I use other people's email address and then I will get all of their info, address, phone number, and order history? You will have a lot of legal issue to deal with....
Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
I did that but it didn't work. Perhaps I should change something else too?


Oh, sorry. The thread ate half of the codes.

form

<input type="checkbox" name="same" id="addressesAreEquals" value="1">id_address_invoice == $cart->id_address_delivery}checked="checked"{/if} />

to


<input type="checkbox" name="same" id="addressesAreEquals" value="0">id_address_invoice > $cart->id_address_delivery}checked="checked"{/if} />

I think it will work.


Thanks Star, it worked for me!
Link to comment
Share on other sites

  • 1 year later...

I need to do the same, but I am using 1.4.7 and my code looks a little different than what is shown above. Can someone tell me how to change this so the checkbox will be unchecked by default?

 

<p class="checkbox">

<input type="checkbox" name="same" id="addressesAreEquals" value="1" onclick="updateAddressesDisplay();{if $opc}updateAddressSelection();{/if}" {if $cart->id_address_invoice == $cart->id_address_delivery || $addresses|@count == 1}checked="checked"{/if} />

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 years later...
×
×
  • Create New...