Customer Comments

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Customer Comments

Post by Brewhaus » Mon Feb 09, 2009 8:22 pm

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Customer Comments

Post by mazhar » Tue Feb 10, 2009 5:35 am

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());
    }

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Customer Comments

Post by mazhar » Tue Feb 10, 2009 5:48 am

If you want to have the shipping messages below the order notes then you can use this version of the invoice page.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Customer Comments

Post by Brewhaus » Tue Feb 10, 2009 8:58 am

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Customer Comments

Post by mazhar » Tue Feb 10, 2009 12:39 pm

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! :)
Yes that's the most suitable location that's why I posted the above code.

bhill
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 84
Joined: Mon Oct 31, 2005 5:06 pm
Location: Institute

Re: Customer Comments

Post by bhill » Thu Mar 05, 2009 11:54 am

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!

dave@givemore.com
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Tue Jan 13, 2009 11:11 am

Re: Customer Comments; adding Fax number

Post by dave@givemore.com » Thu May 14, 2009 8:33 am

Can someone help me with adding the Fax number to the Print/Invoice.aspx page?

Thanks.
Give More Media
http://www.givemore.com/

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Customer Comments

Post by mazhar » Thu May 14, 2009 8:59 am

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());
    }

User avatar
Jaz
Captain (CAPT)
Captain (CAPT)
Posts: 245
Joined: Wed Nov 05, 2008 4:04 am
Location: Torrance, CA
Contact:

Re: Customer Comments

Post by Jaz » Thu Mar 25, 2010 4:16 am

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 &nbsp; 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 &nbsp; 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! --

JKstang
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Tue Feb 17, 2009 3:17 pm

Re: Customer Comments

Post by JKstang » Thu Apr 22, 2010 4:16 pm

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?

JKstang
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Tue Feb 17, 2009 3:17 pm

Re: Customer Comments

Post by JKstang » Fri Apr 23, 2010 6:33 pm

No one has a solution for v7.04?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Customer Comments

Post by jmestep » Sat Apr 24, 2010 7:47 am

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

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Customer Comments

Post by compunerdy » Sun Oct 31, 2010 11:52 pm

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Customer Comments

Post by mazhar » Tue Mar 08, 2011 8:38 am

In packing slip aspx page locate following code

Code: Select all

<asp:Label ID="ShipTo" runat="server" Text='<%#((OrderShipment)Container.DataItem).FormatToAddress()%>'></asp:Label>
and update it like

Code: Select all

<asp:Label ID="ShipTo" runat="server" Text='<%#GetToAddress(Container.DataItem)%>'></asp:Label>
and then add following method to its CS file.

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;
    }
hopefully it will fix it for packing slips.

mkeith1
Commander (CMDR)
Commander (CMDR)
Posts: 120
Joined: Wed Jul 25, 2007 12:46 pm
Contact:

Re: Customer Comments

Post by mkeith1 » Tue Nov 29, 2011 6:37 pm

Can someone provide the code for adding customer comments to Invoices.aspx for version 7.07

Thanks!

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Customer Comments

Post by mazhar » Wed Nov 30, 2011 8:05 am

mkeith1 wrote:Can someone provide the code for adding customer comments to Invoices.aspx for version 7.07

Thanks!
Are you looking for this
viewtopic.php?f=42&t=15747#p67909

Post Reply