Page 1 of 1
Add Phone and Email to PackingList
Posted: Thu Mar 19, 2009 7:11 pm
by digitalguru
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.
Re: Add Phone and Email to PackingList
Posted: Fri Mar 20, 2009 6:35 am
by mazhar
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>
Re: Add Phone and Email to PackingList
Posted: Fri Mar 20, 2009 8:58 am
by digitalguru
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>
Re: Add Phone and Email to PackingList
Posted: Fri Mar 20, 2009 9:11 am
by mazhar
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>
Re: Add Phone and Email to PackingList
Posted: Fri Mar 20, 2009 9:26 am
by digitalguru
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>
Re: Add Phone and Email to PackingList
Posted: Fri Mar 20, 2009 9:26 am
by digitalguru
How do I get the file ...Admin/Orders/Shipments/PackingList.aspx to include the Phone and Email address?
Re: Add Phone and Email to PackingList
Posted: Fri Mar 20, 2009 9:47 am
by mazhar
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;
Re: Add Phone and Email to PackingList
Posted: Fri Mar 20, 2009 10:02 am
by digitalguru
Thank you very much. It works.
I added a <br /> to put the phone on the next line instead of on one line.