There are three address in printable tax invoice page. They are warehouse address, ship to address and sold to address. My problem is AU for warehouse country ,AUSTRALIA for sold to country and AU for Ship to address. This looks not good. We want they are consistent. If it's country code then all display AU. If it's country name then all display AUSTRALIA.
Is this can be done in some way?
Country code and country name
Re: Country code and country name
Give a try to this fix. Edit your Website/Admin/Orders/Print/Invoices.aspx.cs file and locate following code
and replace it with
Then you need to add following code just above the last two curly brances
Save the file.
Now edit Website/Admin/Orders/Print/Invoices.aspx file and locate following code
and replace it with
Save the file and now if every thing went smooth it should be showing country name for both warehouse and shipping address. I am attaching the modified version of my Invoices.aspx page so you can use it for reference if you have any trouble applying above changes.
Code: Select all
string shipTo = shipment.FormatToAddress();
Code: Select all
IAddressFormatter formatter = AbleContext.Container.Resolve<IAddressFormatter>();
string shipTo = formatter.Format(shipment.ShipToFullName, shipment.ShipToCompany, shipment.ShipToAddress1, shipment.ShipToAddress2, shipment.ShipToCity, shipment.ShipToProvince, shipment.ShipToPostalCode, shipment.ShipToCountryCode, shipment.ShipToPhone, shipment.ShipToFax, shipment.ShipToEmail, true);
Code: Select all
protected string GetWarehouseAddress()
{
CommerceBuilder.Shipping.Warehouse warehouse = AbleContext.Current.Store.DefaultWarehouse;
IAddressFormatter formatter = AbleContext.Container.Resolve<IAddressFormatter>();
return formatter.Format(string.Empty, string.Empty, warehouse.Address1, warehouse.Address2, warehouse.City, warehouse.Province, warehouse.PostalCode, warehouse.Country.Id, warehouse.Phone, warehouse.Fax, warehouse.Email, true);
}
Now edit Website/Admin/Orders/Print/Invoices.aspx file and locate following code
Code: Select all
<%# AbleContext.Current.Store.DefaultWarehouse.FormatAddress(true) %>
Code: Select all
<%= GetWarehouseAddress() %>
Re: Country code and country name
BTW just for reference I have reported this issue as bug.