How to show shipping and billing country in an invoice?

How to show shipping and billing country in an invoice?



I just checked customer invoice and I haven’t found customer’s country in an invoice. How should I do?

Heres my invoice template file



[URL=“http://www.remoteone.com.au/csc1/software/cs-cart-mods/”]http://www.remoteone.com.au/csc1/software/cs-cart-mods/[/URL]

Same problem here (v2.10). I can’t get the printed invoice to display customer billing/ shipping state or country.



All other profile fields print OK in the invoice, and these fields do display OK during checkout, order info pages, profile e-mails and in the packing slip.



So I’m guessing that there’s a problem in invoice.tpl in 2.10, maybe around…



{if $order_info.b_city && $profields_b.b_city || $order_info.b_state_descr && $profields_b.b_state_descr || $order_info.b_zipcode && $profields_b.b_zipcode}



{if $profields_b.b_city}{$order_info.b_city} {/if}{if $profields_b.b_state_descr}{$order_info.b_state_descr} {/if}{if $profields_b.b_zipcode}{$order_info.b_zipcode}{/if}



{/if}

{if $order_info.b_country_descr && $profields_b.b_country_descr}



{$order_info.b_country_descr}



{/if}



Is anyone on 2.10 able to print these fields in their invoices? Any ideas?



Cheers

Sorry, just noticed an error in the code above



{$order_info.b_state_de scr} (extra space). That’s not the problem and is not in the original code (no idea how it found it’s way into my post though).

[quote name=‘3am’]Sorry, just noticed an error in the code above



{$order_info.b_state_de scr} (extra space). That’s not the problem and is not in the original code (no idea how it found it’s way into my post though).[/quote]



encase all code within [code ] [/code ] brackets (remove the extra space)

We’ve run into this issue with some of our cs-cart customers.



For now we’ve simply changed the following text in the invoice.tpl to work around it:



b_state_descr to b_state

s_state_descr to s_state



This needs to be changed on both $profields and $order_info in the template (i.e. $profields_b.b_state_descr and $order_info.b_state_descr, though you could change ONLY $profields_b.b_state_descr if you want, and the full state name will print on the invoice.)



The issue is that $profields_b.b_state_descr is either not set in the template, or is set to false, and thus the condition is failing. $profields_b.b_state is set properly, however.



This will solve the state display issue, and display the state abbreviation rather than the entire state name. A little poking around shows that this was how the invoice.tpl was set up for 2.0.9 for at least the default skin. Perhaps they changed this in 2.0.10 but failed to properly set the $profields_b.b_state_descr variable within the code.



In the profile fields area of the admin, the state description isn’t even a field you can require - only the state is. Perhaps it can be said that if state is required, by default state description is also, but obviously there is a core code problem that results in that not being set properly.