Jump to content
icemoist

How to remove invoice address

Recommended Posts

Hello is there a way to remove the invoice address? I mean I need only one address, invoices will never be sent so all we need is the shipping address.

Share this post


Link to post
Share on other sites

See this post on how to modify one page checkout. I think it is close to what you are looking for.

http://www.prestasho...__fromsearch__1

 

Yeah it's similar but not the same, and anyway it is not solved, a user asked and no one replied, like in the majority of this forum threads. We need more experts!

Share this post


Link to post
Share on other sites

In order-address.tpl comment this:

 

{*

 

<p class="checkbox" {if $cart->isVirtualCart()}style="display:none;"{/if}>

<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} />

<label for="addressesAreEquals">{l s='Use the same address for billing.'}</label>

</p>

 

<p id="address_invoice_form" class="select" {if $cart->id_address_invoice == $cart->id_address_delivery}style="display: none;"{/if}>

 

 

{if $addresses|@count > 1}

 

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

<select name="id_address_invoice" id="id_address_invoice" class="address_select" onchange="updateAddressesDisplay();{if $opc}updateAddressSelection();{/if}">

{section loop=$addresses step=-1 name=address}

<option value="{$addresses[address].id_address|intval}" {if $addresses[address].id_address == $cart->id_address_invoice && $cart->id_address_delivery != $cart->id_address_invoice}selected="selected"{/if}>{$addresses[address].alias|escape:'htmlall':'UTF-8'}</option>

{/section}

</select>

{else}

<a style="margin-left: 221px;" href="{$link->getPageLink('address.php', true)}?back={$back_order_page}?step=1&select_address=1{if $back}&mod={$back}{/if}" title="{l s='Add'}" class="button_large">{l s='Add a new address'}</a>

{/if}

 

*}

 

 

 

and this:

 

 

{* <ul class="address alternate_item {if $cart->isVirtualCart()}full_width{/if}" id="address_invoice"> *}

 

 

 

 

In order-detail.tpl comment this:

 

 

{*

 

<ul class="address alternate_item {if $order->isVirtual()}full_width{/if}">

<li class="address_title">{l s='Delivery'}</li>

{foreach from=$dlv_adr_fields name=dlv_loop item=field_item}

{if $field_item eq "company" && isset($address_delivery->company)}<li class="address_company">{$address_delivery->company|escape:'htmlall':'UTF-8'}</li>

{elseif $field_item eq "address2" && $address_delivery->address2}<li class="address_address2">{$address_delivery->address2|escape:'htmlall':'UTF-8'}</li>

{elseif $field_item eq "phone_mobile" && $address_delivery->phone_mobile}<li class="address_phone_mobile">{$address_delivery->phone_mobile|escape:'htmlall':'UTF-8'}</li>

{else}

{assign var=address_words value=" "|explode:$field_item}

<li>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item}">{$deliveryAddressFormatedValues[$word_item]|escape:'htmlall':'UTF-8'}</span>{/foreach}</li>

{/if}

{/foreach}

</ul>

 

 

}*

 

 

 

In order-opc-new-account.tpl comment:

 

 

{*

<p class="checkbox is_customer_param">

<input type="checkbox" name="invoice_address" id="invoice_address" />

<label for="invoice_address"><b>{l s='Please use another address for invoice'}</b></label>

</p>

 

 

*}

  • Like 1

Share this post


Link to post
Share on other sites

What emagiero said. But with the following adjustments:

 

In order-address.tpl add this (just before the first part you commented out here):

 

<input type="hidden" name="same" id="addressesAreEquals" value="1"/>

 

otherwise you will not be able to continue to the next step after selecting your address

 

 

In shopping-cart.tpl comment this:

 

{*

{if $invoice->id}

<ul id="invoice_address" class="address alternate_item">

<li class="address_title">{l s='Invoice address'}</li>

{if $invoice->company}<li class="address_company">{$invoice->company|escape:'htmlall':'UTF-8'}</li>{/if}

<li class="address_name">{$invoice->firstname|escape:'htmlall':'UTF-8'} {$invoice->lastname|escape:'htmlall':'UTF-8'}</li>

<li class="address_address1">{$invoice->address1|escape:'htmlall':'UTF-8'}</li>

{if $invoice->address2}<li class="address_address2">{$invoice->address2|escape:'htmlall':'UTF-8'}</li>{/if}

<li class="address_city">{$invoice->postcode|escape:'htmlall':'UTF-8'} {$invoice->city|escape:'htmlall':'UTF-8'}</li>

<li class="address_country">{$invoice->country|escape:'htmlall':'UTF-8'} {if $invoice_state}({$invoice_state|escape:'htmlall':'UTF-8'}){/if}</li>

</ul>

{/if}

*}

 

Otherwise your invoice address will be shown in the shoppingcart if you return to the shopping cart after selecting an address

Share this post


Link to post
Share on other sites

HI

 

I have followed all these steps and it has all worked. However if you go to your basket the invoice address is still shown. Any ideas? It is not their during checkout, just in the basket.

 

Any help would be great.

Thanks

Share this post


Link to post
Share on other sites

Hi Kevinab,

in the file shopping-cart.tpl

To remove invoce address from the basket .

                after the line :

{foreach from=$formattedAddresses key=k item=address}

add the following lline:

                    {if $k neq 'invoice' } end before the loop ends close the if

 

the code will be like this:

 

  {foreach from=$formattedAddresses key=k item=address}
                    {if $k neq 'invoice' }
                    <div class="col-xs-12 col-sm-6"{if $k == 'delivery' && !$have_non_virtual_products} style="display: none;"{/if}>
                        <ul class="address {if $address@last}last_item{elseif $address@first}first_item{/if} {if $address@index % 2}alternate_item{else}item{/if} box">
                            <li>
                                <h3 class="page-subheading">
                                    {if $k eq 'invoice'}
                                        {l s='Invoice address'}
                                    {elseif $k eq 'delivery' && $delivery->id}
                                        {l s='Delivery address'}
                                    {/if}
                                    {if isset($address.object.alias)}
                                        <span class="address_alias">({$address.object.alias})</span>
                                    {/if}
                                </h3>
                            </li>
                            {foreach $address.ordered as $pattern}
                                {assign var=addressKey value=" "|explode:$pattern}
                                {assign var=addedli value=false}
                                {foreach from=$addressKey item=key name=foo}
                                {$key_str = $key|regex_replace:AddressFormat::_CLEANING_REGEX_:""}
                                    {if isset($address.formated[$key_str]) && !empty($address.formated[$key_str])}
                                        {if (!$addedli)}
                                            {$addedli = true}
                                            <li><span class="{if isset($addresses_style[$key_str])}{$addresses_style[$key_str]}{/if}">
                                        {/if}
                                        {$address.formated[$key_str]|escape:'html':'UTF-8'}
                                    {/if}
                                    {if ($smarty.foreach.foo.last && $addedli)}
                                        </span></li>
                                    {/if}
                                {/foreach}
                            {/foreach}
                        </ul>
                    </div>
                    {/if}

 

 

Regards

Edited by fedotv (see edit history)

Share this post


Link to post
Share on other sites

And what do you think about this CSS code :

#block-order-detail .col-xs-12.col-sm-6 .address.item.box,
.order_delivery .col-xs-12.col-sm-6 .address.alternate_item{display:none}
.col-xs-12.col-sm-6 #address_invoice,
.checkbox.addressesAreEquals{visibility:hidden}
  • Like 1

Share this post


Link to post
Share on other sites
On 7/8/2016 at 10:09 PM, AlainR said:

And what do you think about this CSS code :


#block-order-detail .col-xs-12.col-sm-6 .address.item.box,
.order_delivery .col-xs-12.col-sm-6 .address.alternate_item{display:none}
.col-xs-12.col-sm-6 #address_invoice,
.checkbox.addressesAreEquals{visibility:hidden}

where does this go - what does it do?

Share this post


Link to post
Share on other sites
8 hours ago, bnadauld said:

where does this go - what does it do?

CSS code goes... in CSS file

And this code hides the billing address and the possibility of choosing 2 different addresses (the check box is also hidden).

 

Share this post


Link to post
Share on other sites

Does anybody know how to  hide everything about invoice address during checkout in PS 1.7.4.2    (classic theme) ? 

I have already deleted invoice address from all other places, but it must be  something  done with themes/classic/templates/checkout/_partials/steps/addresses.tpl and I do something wrong... 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More