Adding description text to confirmation and my account pages

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
User avatar
caveman
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Fri Dec 19, 2008 11:08 am
Location: Indio, Ca
Contact:

Adding description text to confirmation and my account pages

Post by caveman » Mon Dec 29, 2008 6:58 pm

Does anyone know how to add the more "details text" to the order confirmation pages as well as the my account page?

Image

Image

Thanks.
Luis Garcia
Website Development,
Internet & SEO Marketing
http://www.cavemedia.com

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

Re: Adding description text to confirmation and my account pages

Post by mazhar » Tue Dec 30, 2008 5:28 am

Locate the following code in ConLib/MyAccountPage.ascx

Code: Select all

<asp:TemplateField>
                    <ItemStyle VerticalAlign="top" />
                    <ItemTemplate>
                        <asp:Label ID="ItemsCaption" runat="server" Text="Items" SkinID="FieldHeader"></asp:Label>
                        <asp:Repeater ID="ItemsRepeater" runat="server" DataSource='<%#GetProducts(Container.DataItem)%>'>
                            <HeaderTemplate><ul class="orderItemsList"></HeaderTemplate>
                            <ItemTemplate><li><%#Eval("Quantity")%> of: <%#GetOrderItemName(Container.DataItem)%></li></ItemTemplate>
                            <FooterTemplate></ul></FooterTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:TemplateField>
and make it look like

Code: Select all

<asp:TemplateField>
                    <ItemStyle VerticalAlign="top" />
                    <ItemTemplate>
                        <asp:Label ID="ItemsCaption" runat="server" Text="Items" SkinID="FieldHeader"></asp:Label>
                        <asp:Repeater ID="ItemsRepeater" runat="server" DataSource='<%#GetProducts(Container.DataItem)%>'>
                            <HeaderTemplate><ul class="orderItemsList"></HeaderTemplate>
                            <ItemTemplate><li><%#Eval("Quantity")%> of: <%#GetOrderItemName(Container.DataItem)%><br />More info text here</li></ItemTemplate>
                            <FooterTemplate></ul></FooterTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:TemplateField>

User avatar
caveman
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Fri Dec 19, 2008 11:08 am
Location: Indio, Ca
Contact:

Re: Adding description text to confirmation and my account pages

Post by caveman » Tue Dec 30, 2008 8:15 am

Thanks Mazah, but that's not what I meant. I want to display the Products.ExtendedText field from the database which is the "More text" information for the product.
Luis Garcia
Website Development,
Internet & SEO Marketing
http://www.cavemedia.com

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

Re: Adding description text to confirmation and my account pages

Post by mazhar » Tue Dec 30, 2008 8:37 am

Use this code

Code: Select all

<ItemTemplate><li><%#Eval("Quantity")%> of: <%#GetOrderItemName(Container.DataItem)%><br /><%#Eval("Product.ExtendedDescription") %></li></ItemTemplate>

User avatar
caveman
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Fri Dec 19, 2008 11:08 am
Location: Indio, Ca
Contact:

Re: Adding description text to confirmation and my account pages

Post by caveman » Tue Dec 30, 2008 8:54 am

Perfect! Thanks.
Luis Garcia
Website Development,
Internet & SEO Marketing
http://www.cavemedia.com

User avatar
caveman
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Fri Dec 19, 2008 11:08 am
Location: Indio, Ca
Contact:

Re: Adding description text to confirmation and my account pages

Post by caveman » Tue Dec 30, 2008 10:10 am

Can anyone help me build a simple if statement to display on MyAccountPage.ascx?

if (Product.ExtendedDescription =! "Payment Authorized") {
#Eval("Product.ExtendedDescription") // write this from database
}
else
{
"This transaction failed";
}
Luis Garcia
Website Development,
Internet & SEO Marketing
http://www.cavemedia.com

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

Re: Adding description text to confirmation and my account pages

Post by mazhar » Tue Dec 30, 2008 10:19 am

If you want to put this logic in place of above code then first you can create a function as below in code file of control

Code: Select all

public string GetMessage(Object dataItem)
    {
        CommerceBuilder.Products.Product product = (CommerceBuilder.Products.Product)dataItem;
        if (product.ExtendedDescription != "Payment Authorized")
            return product.ExtendedDescription;
        return "This transaction failed";
    }
and then you can call this function from the ascx file for appropriate message as below

Code: Select all

<ItemTemplate><li><%#Eval("Quantity")%> of: <%#GetOrderItemName(Container.DataItem)%><br /><%# GetMessage(Eval("Product")) %></li></ItemTemplate>

User avatar
caveman
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Fri Dec 19, 2008 11:08 am
Location: Indio, Ca
Contact:

Re: Adding description text to confirmation and my account pages

Post by caveman » Tue Dec 30, 2008 11:07 am

I'm an idiot... I meant the if statement to look at orders.Status field:

Code: Select all

public string GetMessage(Object dataItem)
    {
        CommerceBuilder.Products.Product product = (CommerceBuilder.Products.Product)dataItem;
        if (ORDERS.STATUS FIELD != "Payment Authorized")
            return product.ExtendedDescription;
        return "This transaction failed";
    }
Luis Garcia
Website Development,
Internet & SEO Marketing
http://www.cavemedia.com

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

Re: Adding description text to confirmation and my account pages

Post by mazhar » Thu Jan 01, 2009 7:51 am

Check the following function in code file

Code: Select all

 protected string GetOrderStatus(object dataItem)
    {
        Order order = (Order)dataItem;
        OrderStatus status = order.OrderStatus;
        if (status == null) return string.Empty;
        return StringHelper.SpaceName(status.DisplayName);
    }
and following statement in ascx file of MyAccountPage control

Code: Select all

<asp:Label ID="Status" runat="server" Text='<%#GetOrderStatus(Container.DataItem)%>'></asp:Label>

Post Reply