Add phone number to packing slip

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
gio50000
Commander (CMDR)
Commander (CMDR)
Posts: 123
Joined: Mon Feb 18, 2008 12:51 pm
Location: Orlando, FL
Contact:

Add phone number to packing slip

Post by gio50000 » Sun Nov 16, 2008 7:10 pm

I would like to add the customers phone number to the packing slip. After I edit the Website\Admin\Orders\Print\PackSlips.aspx page what snippet of code do I have to add?

Thanks,
Gio
Thank you,
Gio

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

Re: Add phone number to packing slip

Post by mazhar » Mon Nov 17, 2008 3:02 am

Edit the Admin/Orders/Print/PackSlips.aspx file and locate the 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() + GetPhoneNumber(Container.DataItem)%>'></asp:Label>
Now add the following method in the script section

Code: Select all

protected string GetPhoneNumber(Object dataItem) 
    {
        OrderShipment orderShipment = (OrderShipment)dataItem;
        if (String.IsNullOrEmpty(orderShipment.ShipToPhone))
            return string.Empty;
        return "<br /> Phone# " + orderShipment.ShipToPhone;
    }
These changes will append the customer phone number in the ShipTo address section.

User avatar
gio50000
Commander (CMDR)
Commander (CMDR)
Posts: 123
Joined: Mon Feb 18, 2008 12:51 pm
Location: Orlando, FL
Contact:

Re: Add phone number to packing slip

Post by gio50000 » Mon Nov 17, 2008 8:54 am

Mazhar - it worked like a charm.

I would like to add the email address to the packing slip. I could use the same example but I don't know the email dataitem.

Gio
Thank you,
Gio

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

Re: Add phone number to packing slip

Post by mazhar » Mon Nov 17, 2008 8:57 am

You can use the ShipToEmail property like

Code: Select all

return "Email: "+orderShipment.ShipToEmail;

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

Re: Add phone number to packing slip

Post by mazhar » Mon Nov 17, 2008 9:00 am

Very helpful post about putting Email address on the PackSlip have a look at it.
viewtopic.php?f=44&t=7913&p=33547

Post Reply