Need a slight change to the My Digital Goods Page

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
snap624
Lieutenant (LT)
Lieutenant (LT)
Posts: 58
Joined: Mon Jan 19, 2009 2:53 pm

Need a slight change to the My Digital Goods Page

Post by snap624 » Sat Jul 24, 2010 12:14 pm

How can I add an Order Date column to the My Digital Goods Page that posts the correct date for a particular order? I can get the column to come up, but I am having trouble getting the correct date to post. Adding an Order Number column would be helpful as well. Thanks for any help.

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

Re: Need a slight change to the My Digital Goods Page

Post by mazhar » Mon Jul 26, 2010 5:22 am

Edit your ConLib/MyDigitalGoodsPage.ascx file and locate following code line

Code: Select all

</Columns>
then update it as

Code: Select all

<asp:TemplateField HeaderText="Date" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>                    
                <%#GetOrderDate(Container.DataItem)%>
            </ItemTemplate>
        </asp:TemplateField>
</Columns>
Then edit ConLib/MyDigitalGoodsPage.ascx.cs file and add following method just above the last closing curly brace

Code: Select all

protected string GetOrderDate(Object dataItem)
    {
        OrderItemDigitalGood oidg = (OrderItemDigitalGood)dataItem;
        return oidg.OrderItem.Order.OrderDate.ToShortDateString();
    }
You are done with changes so just go and test MyDigitalGoods page.

snap624
Lieutenant (LT)
Lieutenant (LT)
Posts: 58
Joined: Mon Jan 19, 2009 2:53 pm

Re: Need a slight change to the My Digital Goods Page

Post by snap624 » Tue Jul 27, 2010 8:13 am

Perfect! Thanks very much!

snap624
Lieutenant (LT)
Lieutenant (LT)
Posts: 58
Joined: Mon Jan 19, 2009 2:53 pm

Re: Need a slight change to the My Digital Goods Page

Post by snap624 » Sat Jan 15, 2011 10:34 am

Is there an easy way to include the Order Time with the Order Date? I have a column that shows when the key was posted with the time, but I can't seem to get the Order date column to show the time also. Thanks in advance for any help.

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

Re: Need a slight change to the My Digital Goods Page

Post by mazhar » Mon Jan 17, 2011 4:58 am

Try adding one more column in grid like

Code: Select all

<asp:TemplateField HeaderText="Order Date" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="OrderDateLabel" runat="server" Text='<%#Eval("OrderItem.Order.OrderDate")%>'></asp:Label>
            </ItemTemplate>
</asp:TemplateField>

snap624
Lieutenant (LT)
Lieutenant (LT)
Posts: 58
Joined: Mon Jan 19, 2009 2:53 pm

Re: Need a slight change to the My Digital Goods Page

Post by snap624 » Mon Jan 17, 2011 9:46 am

That works. :D Thanks very much!

Post Reply