Add Phone and Email to PackingList

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
digitalguru
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Thu Mar 19, 2009 3:30 pm

Add Phone and Email to PackingList

Post by digitalguru » Thu Mar 19, 2009 7:11 pm

I've attempted to use examples of getting the PackingList.aspx file under Admin/Orders/Shipments to have the Email address and phone number included in the packing list.

When I display the packing slip under orders/shipment... I do not see the Email or Phone information

Please advise.

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

Re: Add Phone and Email to PackingList

Post by mazhar » Fri Mar 20, 2009 6:35 am

Locate following code Admin/Order/Print/PackSlipts.aspx and locate following code

Code: Select all

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

Code: Select all

<asp:Label ID="ShipTo" runat="server" Text='<%#((OrderShipment)Container.DataItem).FormatToAddress()%>'></asp:Label>
<asp:Label ID="ShipToEmail" runat="server" Text='<%#((OrderShipment)Container.DataItem).ShipToEmail%>'></asp:Label>
                        <asp:Label ID="ShipToPhone" runat="server" Text='<%#((OrderShipment)Container.DataItem).ShipToPhone%>'></asp:Label>

digitalguru
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Thu Mar 19, 2009 3:30 pm

Re: Add Phone and Email to PackingList

Post by digitalguru » Fri Mar 20, 2009 8:58 am

NOTE: There 2 files with similar names
...Admin/Orders/Print/PackSlips.aspx
...Admin/Orders/Shipments/PackingList.aspx

I made the changes to the PackSlips.aspx file.

I attempted to test the changes. The only orders that I have are completed orders. When I displayed the PackingSlip.aspx file I received the error below.

I checked the file and do not have a 'ShipToEmail' anywhere else in this file.


Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The ID 'ShipToEmail' is already used by another control.

Source Error:

Line 165: <asp:Label ID="ShipTo" runat="server" Text='<%#((OrderShipment)Container.DataItem).FormatToAddress()%>'></asp:Label>
Line 166: <asp:Label ID="ShipToEmail" runat="server" Text='<%#Eval("ShipToEmail") %>'></asp:Label>
Line 167: <asp:Label ID="ShipToEmail" runat="server" Text='<%#Eval("ShipToPhone") %>'></asp:Label>
Line 168: </td>
Line 169: </tr>

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

Re: Add Phone and Email to PackingList

Post by mazhar » Fri Mar 20, 2009 9:11 am

digitalguru wrote:NOTE: There 2 files with similar names
...Admin/Orders/Print/PackSlips.aspx
...Admin/Orders/Shipments/PackingList.aspx

I made the changes to the PackSlips.aspx file.

I attempted to test the changes. The only orders that I have are completed orders. When I displayed the PackingSlip.aspx file I received the error below.

I checked the file and do not have a 'ShipToEmail' anywhere else in this file.


Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The ID 'ShipToEmail' is already used by another control.

Source Error:

Line 165: <asp:Label ID="ShipTo" runat="server" Text='<%#((OrderShipment)Container.DataItem).FormatToAddress()%>'></asp:Label>
Line 166: <asp:Label ID="ShipToEmail" runat="server" Text='<%#Eval("ShipToEmail") %>'></asp:Label>
Line 167: <asp:Label ID="ShipToEmail" runat="server" Text='<%#Eval("ShipToPhone") %>'></asp:Label>
Line 168: </td>
Line 169: </tr>
In following code it seems that you have two controls with same names. Use different names for different labels.

Line 166: <asp:Label ID="ShipToEmail" runat="server" Text='<%#Eval("ShipToEmail") %>'></asp:Label>
Line 167: <asp:Label ID="ShipToEmail" runat="server" Text='<%#Eval("ShipToPhone") %>'></asp:Label>

digitalguru
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Thu Mar 19, 2009 3:30 pm

Re: Add Phone and Email to PackingList

Post by digitalguru » Fri Mar 20, 2009 9:26 am

I updated the file ...Admin/Orders/Print/PackSlips.aspx

to include the following code:


<asp:Label ID="ShipToCaption" runat="server" Text="Ship To:" SkinID="FieldHeader"></asp:Label><br />
<asp:Label ID="ShipTo" runat="server" Text='<%#((OrderShipment)Container.DataItem).FormatToAddress()%>'></asp:Label>
<asp:Label ID="ShipToEmail" runat="server" Text='<%#Eval("ShipToEmail") %>'></asp:Label
<asp:Label ID="ShipToPhone" runat="server" Text='<%#Eval("ShipToPhone") %>'></asp:Label>

digitalguru
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Thu Mar 19, 2009 3:30 pm

Re: Add Phone and Email to PackingList

Post by digitalguru » Fri Mar 20, 2009 9:26 am

How do I get the file ...Admin/Orders/Shipments/PackingList.aspx to include the Phone and Email address?

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

Re: Add Phone and Email to PackingList

Post by mazhar » Fri Mar 20, 2009 9:47 am

Edit the file and locate following code

Code: Select all

<asp:Label ID="ShipTo" runat="server" Text="" ></asp:Label>
and then make it look like

Code: Select all

<asp:Label ID="ShipTo" runat="server" Text="" ></asp:Label>
            <br />
            <asp:Label ID="ShipToEmail" runat="server" Text="" ></asp:Label>
            <asp:Label ID="ShipToPhone" runat="server" Text="" ></asp:Label>
Then find following piece of code

Code: Select all

ShipTo.Text = _OrderShipment.FormatToAddress();
and make it look like

Code: Select all

ShipTo.Text = _OrderShipment.FormatToAddress();
            ShipToEmail.Text = _OrderShipment.ShipToEmail;
            ShipToPhone.Text = _OrderShipment.ShipToPhone;

digitalguru
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Thu Mar 19, 2009 3:30 pm

Re: Add Phone and Email to PackingList

Post by digitalguru » Fri Mar 20, 2009 10:02 am

Thank you very much. It works.

I added a <br /> to put the phone on the next line instead of on one line.

Post Reply