Jump to content

Just show billing address on invoice when it equals the delivery address


fireatwire

Recommended Posts

Hi! I would like to just show the billing address on the invoice when it equals the delivery address. If it is exactly the same address, it doesn't make sense to have it twice on the PDF invoice. How can I change it? 

Something like

{if $delivery_address == $invoice_address} 

$invoice_address

else

<tr>
        <td width="50%">{if $delivery_address}<span class="bold">{l s='Delivery Address' d='Shop.Pdf' pdf='true'}</span><br/>
                {$delivery_address}
            {/if}
        </td>
        <td width="50%"><span class="bold">{l s='Billing Address' d='Shop.Pdf' pdf='true'}</span><br/>
                {$invoice_address}
        </td>
    </tr>

 

Link to comment
Share on other sites

  • 1 month later...

You can compare their ids to see if they are the same.

{if $addresses.invoice.id eq $addresses.delivery.id}

like this

{if $addresses.invoice.id eq $addresses.delivery.id}
  <tr>
      <td width="100%" colspan="2"><span class="bold">{l s='Billing Address' d='Shop.Pdf' pdf='true'}</span><br/>
          {$invoice_address}
      </td>
  </tr>
{else}
  <tr>
      <td width="50%">
          {if $delivery_address}<span class="bold">{l s='Delivery Address' d='Shop.Pdf' pdf='true'}</span><br/>
              {$delivery_address}
          {/if}
      </td>
      <td width="50%"><span class="bold">{l s='Billing Address' d='Shop.Pdf' pdf='true'}</span><br/>
          {$invoice_address}
      </td>
  </tr>
{/if}

 

Edited by Ress (see edit history)
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...