+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Style DiscountList

Style DiscountList

4 posts, 0 answered
  1. Henriette
    Henriette avatar
    41 posts
    Registered:
    20 Aug 2009
    05 Aug 2013
    Link to this post
    Hallo all

    We would like to  style the discountlistview that are included in the checkout template, but we are unable to find where that is stored?

     <orders:DiscountList runat="server" ID="discountRows"/>

    Kind regards
    Henrik Stensgaard
  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    05 Aug 2013
    Link to this post
    Hello Henrik,

     Thank you for using Sitefinity.

    Here is the template for that control. You can find all the templates for controls (frontend or backend) including the non-standard ones in the toolbox in the SDK.

    <%@ Control Language="C#" %>
    <%@ Import Namespace="Telerik.Sitefinity.Ecommerce" %>
    <%@ Import Namespace="Telerik.Sitefinity.Modules.Ecommerce" %>
    <%@ Register TagPrefix="orders" Namespace="Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI" Assembly="Telerik.Sitefinity.Ecommerce" %>
      
    <asp:Repeater ID="discountsListView" runat="server">
        <ItemTemplate>
            <tr>
                <th>
                    <div>
                        <%# HttpUtility.HtmlEncode(DataBinder.Eval(Container.DataItem, "Title")) %>:
                    </div>
                </th>
                <td class="sfDiscount">
                    <%# DataBinder.Eval(Container.DataItem, "SavingsAmountFormatted")%>
                </td>
            </tr>
            <orders:CouponCodeEntryListView visible="False" ID="changeCouponCodeEntryView" runat="server" IsChangeMode="True"/>
        </ItemTemplate>
    </asp:Repeater>

    You can add this to the control like so:

    <orders:DiscountList runat="server" ID="discountRows" LayoutTemplatePath="~/YOURPATH/FileName.ascx"/>

    Make sure you change the file path and name to reflect your own.

    Regards,
    Patrick Dunn
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Henriette
    Henriette avatar
    41 posts
    Registered:
    20 Aug 2009
    06 Aug 2013 in reply to Patrick Dunn
    Link to this post
    Hi Patrick
    Many thanks for your reply. I think I get it, but I get the below error when i attach my own template. The template is the same as above also with the same names etc,, not changed yet?: 

    NullReferenceException: Object reference not set to an instance of an object.] Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.DiscountList.DiscountRepeater_ItemDataBound(Object sender, RepeaterItemEventArgs e) +121 

    How do I solve this with the ItemDatabound event?
    Best regards
    Henrik Stensgaard
  4. Henriette
    Henriette avatar
    41 posts
    Registered:
    20 Aug 2009
    06 Aug 2013 in reply to Henriette
    Link to this post
    Hallo again

    Sorry I found the error. I had removed the CouponCodeEntryListView, that was causing the error.
    Best regards
    Henrik Stensgaard
4 posts, 0 answered