Customer Comments
Re: Customer Comments
Because customers sometimes add their notes after completing the order, and others add their notes in the 'shipping message' section at the checkout, we need to have both printed on the invoice in order to avoid missing every customer's instructions. I tried to copy the ship message information from the original packing list file, but could not get it to work. Can anyone help with the code that we need to add in order to get the shipping messages to print above or below the order notes?
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Customer Comments
In order to print shipping messages with the shipping address information all you need is to modify the GetShipToAddress method
Code: Select all
protected string GetShipToAddress(object dataItem)
{
Order order = (Order)dataItem;
List<string> addressList = new List<string>();
foreach (OrderShipment shipment in order.Shipments)
{
string shipTo = shipment.FormatToAddress();
if (!addressList.Contains(shipTo))
{
if (!string.IsNullOrEmpty(shipment.ShipMessage))
shipTo += "<br /><b>Shipping Note:</b> " + shipment.ShipMessage;
addressList.Add(shipTo);
}
}
if (addressList.Count == 0) return "n/a";
return string.Join("<hr />", addressList.ToArray());
}
Re: Customer Comments
If you want to have the shipping messages below the order notes then you can use this version of the invoice page.
Re: Customer Comments
We left the shipping note with the shipping address so that it stands out to the person handling shipping (they will see any notes when confirming the shipping address). Thank you! 

Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Customer Comments
Yes that's the most suitable location that's why I posted the above code.Brewhaus wrote:We left the shipping note with the shipping address so that it stands out to the person handling shipping (they will see any notes when confirming the shipping address). Thank you!
Re: Customer Comments
Can someone post code of how to add user notes to the packing slip? (not the invoice). Packing slip is what our warehouse uses and it would be helpful to have customer notes on the packing slip as well as shipping messages.
Thanks!
Thanks!
-
- Ensign (ENS)
- Posts: 20
- Joined: Tue Jan 13, 2009 11:11 am
Re: Customer Comments; adding Fax number
Can someone help me with adding the Fax number to the Print/Invoice.aspx page?
Thanks.
Thanks.
Give More Media
http://www.givemore.com/
http://www.givemore.com/
Re: Customer Comments
Locate and update following two methods in your Admin/Orders/Print/Invoices.aspx page
Code: Select all
protected string GetBillToAddress(object dataItem)
{
string address = ((Order)dataItem).FormatAddress(true);
address += "<br />" + ((Order)dataItem).BillToFax;
return address;
}
protected string GetShipToAddress(object dataItem)
{
Order order = (Order)dataItem;
List<string> addressList = new List<string>();
foreach (OrderShipment shipment in order.Shipments)
{
string shipTo = shipment.FormatToAddress();
if (!addressList.Contains(shipTo))
{
shipTo += "<br />" + shipment.ShipToFax;
addressList.Add(shipTo);
}
}
if (addressList.Count == 0) return "n/a";
return string.Join("<hr />", addressList.ToArray());
}
Re: Customer Comments
I made the mistake of using this invoice.aspx for version 7.03. I found that it screws everything up. Anyhow, I made my own version of this invoice for 7.03. No guarantees, but it seems to be working for me.
Code: Select all
<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" CodeFile="Invoices.aspx.cs" Inherits="Admin_Orders_Print_Invoices" Title="Invoices" %>
<%@ Register Src="../../UserControls/OrderItemDetail.ascx" TagName="OrderItemDetail" TagPrefix="uc" %>
<script runat="server">
protected string GetShipMethods(Object dataItem)
{
Order order = (Order)dataItem;
string shippingMethods = string.Empty;
foreach (OrderShipment orderShipment in order.Shipments)
{
shippingMethods += orderShipment.ShipMethod.Name;
shippingMethods += ",";
}
if (!String.IsNullOrEmpty(shippingMethods))
shippingMethods = shippingMethods.Remove((shippingMethods.Length - 1), 1);
return shippingMethods;
}
protected OrderNoteCollection GetOrderNotes(Object dataItem)
{
OrderNoteCollection orderNotes = new OrderNoteCollection();
Order order = (Order)dataItem;
if (order != null)
{
if (order.Notes != null && order.Notes.Count > 0)
{
foreach (OrderNote on in order.Notes)
if(!on.IsPrivate)
orderNotes.Add(on);
}
}
return orderNotes;
}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
<div class="pageHeader noPrint">
<div class="caption">
<h1><asp:Localize ID="Caption" runat="server" Text="Invoices"></asp:Localize></h1>
</div>
<div class="content">
<h2><asp:Localize ID="OrderListLabel" runat="server" Text="Includes Order Numbers:"></asp:Localize></h2>
<asp:Label ID="OrderList" runat="server" Text=""></asp:Label><br />
<p><asp:Localize ID="PrintInstructions" runat="server" Text="This document includes a printable stylesheet. The latest versions of IE and Firefox browsers will print with appropriate styles and page breaks if needed. Website headers, footers, and this message will not be printed."></asp:Localize></p>
</div>
</div>
<div class="noPrint">
<asp:Button ID="Print" runat="server" Text="Print" OnClientClick="window.print();return false;" />
<asp:Button ID="Back" runat="server" Text="Back" OnClientClick="window.history.go(-1);return false;" />
</div>
<asp:Repeater ID="OrderRepeater" runat="server">
<ItemTemplate>
<table align="center" class="form<%# (Container.ItemIndex < (OrderCount - 1)) ? " breakAfter" : string.Empty %>" cellpadding="0" cellspacing="0" border="1">
<tr>
<td colspan="4" valign="middle">
<div style="float:left">
<br />
<span class="inlineCaption" style="font-size:150%;"><%#Token.Instance.Store.Name%></span>
<br />
<%# Token.Instance.Store.DefaultWarehouse.FormatAddress(true) %>
</div>
<div style="float:right">
<h1 class="invoice">INVOICE</h1>
<asp:Label ID="OrderNumberLabel" runat="server" Text="Order Number:" SkinID="FieldHeader"></asp:Label>
<asp:Label ID="OrderNumber" runat="server" Text='<%# Eval("OrderNumber") %>'></asp:Label><br />
<asp:Label ID="OrderDateLabel" runat="server" Text="Order Date:" SkinID="FieldHeader"></asp:Label>
<asp:Label ID="OrderDate" runat="server" Text='<%# Eval("OrderDate", "{0:g}") %>'></asp:Label><br />
<asp:Label ID="ShippingMethodsLabel" runat="server" SkinID="FieldHeader" Text="Shipping Method: "></asp:Label>
<asp:Label ID="ShippingMethods" runat="server" Text='<%# GetShipMethods(Container.DataItem) %>'></asp:Label>
</div>
</td>
</tr>
<tr>
<td style="width:10px;text-align:center;font-weight:bold" valign="top">
S O L D T O
</td>
<td valign="middle" width="50%">
<%# GetBillToAddress(Container.DataItem) %>
<br /><%# GetEmailPhone(Container.DataItem) %>
</td>
<td style="width:10px;text-align:center;font-weight:bold" valign="top">
S H I P T O
</td>
<td valign="middle" width="50%">
<%# GetShipToAddress(Container.DataItem) %>
</td>
</tr>
<tr>
<td colspan="4" class="dataSheet">
<asp:GridView ID="OrderItems" runat="server" ShowHeader="true"
AutoGenerateColumns="false" CellPadding=0 CellSpacing=0 GridLines="none"
Width="100%" DataSource='<%#GetItems(Container.DataItem)%>' CssClass="dataSheet" OnDataBinding="OrderItems_DataBinding">
<Columns>
<asp:BoundField DataField="Quantity" HeaderText="Quantity" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="SKU">
<ItemStyle HorizontalAlign="Center"/>
<ItemTemplate>
<%#ProductHelper.GetSKU(Container.DataItem)%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tax">
<ItemStyle HorizontalAlign="Center" Width="40px" />
<ItemTemplate>
<%#TaxHelper.GetTaxRate(((OrderItem)Container.DataItem).Order, (OrderItem)Container.DataItem).ToString("0.#")%>%
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Item">
<ItemTemplate>
<uc:OrderItemDetail ID="OrderItemDetail1" runat="server" OrderItem='<%#(OrderItem)Container.DataItem%>' ShowAssets="False" LinkProducts="False" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<ItemStyle HorizontalAlign="right" width="80px" />
<ItemTemplate>
<asp:Label ID="Price" runat="server" Text='<%#TaxHelper.GetInvoiceExtendedPrice(((OrderItem)Container.DataItem).Order, (OrderItem)Container.DataItem).ToString("lc")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<table width="100%" cellpadding="0" cellspacing="0" class="dataSheet">
<tr>
<th align="right">
<asp:Label ID="SubtotalLabel" runat="server" Text="Product Subtotal:" />
</th>
<td align="right" width="80px">
<%# GetProductTotal(Container.DataItem).ToString("lc") %>
</td>
</tr>
<tr>
<th align="right">
<asp:Label ID="ShippingTotalLabel" runat="server" Text="Shipping & Handling:" />
</th>
<td align="right" width="80px">
<%# GetShippingTotal(Container.DataItem).ToString("lc") %>
</td>
</tr>
<tr>
<th align="right">
<asp:Label ID="TaxTotalLabel" runat="server" Text="Taxes:" />
</th>
<td align="right" width="80px">
<%# GetTotal(Container.DataItem, OrderItemType.Tax).ToString("lc") %>
</td>
</tr>
<tr id="trAdjustments" runat="server" visible='<%# ShowAdjustmentsRow(Container.DataItem) %>'>
<th align="right">
<asp:Label ID="AdjustmetnsLabel" runat="server" Text="Adjustments:" />
</th>
<td align="right" width="80px">
<%# GetAdjustmentsTotal(Container.DataItem).ToString("lc")%>
</td>
</tr>
<tr class="totalRow">
<th align="right">
<asp:Label ID="TotalLabel" runat="server" Text="Total:" />
</th>
<td align="right" width="80px">
<%# GetTotal(Container.DataItem).ToString("lc") %>
</td>
</tr>
</table>
</td>
</tr>
<tr >
<td colspan="4" valign="middle">
<asp:GridView ID="OrderNotesRepeater" runat="server" AutoGenerateColumns="false" CellPadding=0 CellSpacing=0 GridLines="none" CssClass="dataSheet" DataSource='<%# GetOrderNotes(Container.DataItem) %>' ShowHeader="true" Width="100%">
<HeaderStyle HorizontalAlign="Left" />
<Columns>
<asp:TemplateField HeaderText="Order Notes" >
<ItemStyle Wrap="true" />
<ItemTemplate>
<asp:Label ID="CommentLabel" runat="server" Text='<%#Eval("Comment") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</asp:Content>
David Jasiewicz
President
Trick Concepts - Metal Fab. Engineering and Product Design
http://www.trickconcepts.com-- If you are an ASP or PHP programmer or CSS web specialist I will gladly trade for graphic design, mechanical engineering or metal fabrication service! --
President
Trick Concepts - Metal Fab. Engineering and Product Design
http://www.trickconcepts.com-- If you are an ASP or PHP programmer or CSS web specialist I will gladly trade for graphic design, mechanical engineering or metal fabrication service! --
Re: Customer Comments
We have been trying to configure our Invoice.aspx to show the exact same info that others above have wanted...couldn't get the notes to show...so we tried to use the above posted code unfortunately we have v7.04.
"Opps!!" Appearently that was the wrong thing to do. Anyone have a version that will work with 7.04?
"Opps!!" Appearently that was the wrong thing to do. Anyone have a version that will work with 7.04?
Re: Customer Comments
No one has a solution for v7.04?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Customer Comments
It looks like the code that was posted is just partial code. Try taking the original file in 7.0.4 and integrating the changes for GetOrderNotes. For example, the above code doesn't have the method for the shipping total that gets called as <%# GetShippingTotal(Container.DataItem).ToString("lc") %>
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
- compunerdy
- Admiral (ADM)
- Posts: 1283
- Joined: Sun Nov 18, 2007 3:55 pm
Re: Customer Comments
What changed in 7.0.5?
My old invoice setup will not work anymore. It just acts like it is loading a page but nothing shows up.
My old invoice setup will not work anymore. It just acts like it is loading a page but nothing shows up.
Re: Customer Comments
In packing slip aspx page locate following code
and update it like
and then add following method to its CS file.
hopefully it will fix it for packing slips.
Code: Select all
<asp:Label ID="ShipTo" runat="server" Text='<%#((OrderShipment)Container.DataItem).FormatToAddress()%>'></asp:Label>
Code: Select all
<asp:Label ID="ShipTo" runat="server" Text='<%#GetToAddress(Container.DataItem)%>'></asp:Label>
Code: Select all
protected string GetToAddress(Object dataItem)
{
OrderShipment orderShipment = (OrderShipment)dataItem;
string toAddress = orderShipment.FormatToAddress();
if(!string.IsNullOrEmpty(orderShipment.ShipToEmail))
toAddress += "<br />"+orderShipment.ShipToEmail;
return toAddress;
}
Re: Customer Comments
Can someone provide the code for adding customer comments to Invoices.aspx for version 7.07
Thanks!
Thanks!
Mike Keith
http://www.musicmart.com
http://www.musicmart.com
Re: Customer Comments
Are you looking for thismkeith1 wrote:Can someone provide the code for adding customer comments to Invoices.aspx for version 7.07
Thanks!
viewtopic.php?f=42&t=15747#p67909