A quantity discount detail control.
By changing the values of the control's properties in the SitePages.config file for your Site, you can enable or disable certain behaviors, set certain defaults, alter aspects of the display or otherwise cusomtize your site's implementaion of the control.
The following describes properties pertaining to key functional areas of the control that can be configured to suit your needs.
Header Properties
There are a number of properties which dictate the header text of this control. These properties include the DescriptionHeaderText, NameHeaderText, PricingHeaderText, StockCodeHeaderText, and QtyinStockHeaderText property which sets the description, name, pricing, stock code, and quantity in stock header text respectively.
Display Properties
There are multiple properties that dictate what is displayed in this control. The following are displays that have a default value of "true" should you wish for these to be displayed you must change the value to "false".
- The ShowDescription sets a value indicating whether to show description.
- The ShowName sets whether the name is shown.
- The ShowQtyinStock sets a value indicating whether to show quantity in stock.
There are multiple properties that dictate what is displayed in this control. The following is a display that has a default value of "false" should you wish for this to be displayed you must change the value to "true".
- The ShowStockCode sets a value indicating whether to show stock code.
Properties Inherited from the Base ItemControl
The properties contained in the ItemControl base class allow for options regarding the type of Item that is in context for the control.
The properties IgnoreWhenModel, IgnoreWhenSKU, and IgnoreWhenStockCode properties can be used to case the ItemControl to not process nor render when the appropriate Item type is valid for the Item.
Properties Inherited from the Base CyberStoreBaseControl
Properties specific to the CyberStoreBaseControl can be listed in the following categories:
- Override Properties
- Contextual Properties
Override Properties
When the IgnoreControl property is set to true, all processing of a control is skipped, and the control's Visible property is set to false ensuring that it is not rendered in the resulting CyberStore page.
Contextual Properties
Contextual properties define specific details about the current instance of the control based on context. Context can be set by any number of factors including the log in state of the Shopper, the Site being visited, or the properties that have been established for a control.
The AttributesBag property is used internal to control processing and is the collection of attributes, or properties, and their values based on how the control is configured. The attributes in this property are set by processing the SitePages.config file as well as any specific declared property values in any registered sub controls. It allows for the passing down of all properties to a control and any registered sub controls.
The ComConfig, UserData and Site_ID properties are read-only values made available to all CyberStore controls to aid in processing and establishing context about the Site and Shopper.
The table below lists and describes sub controls used by the default CatalogItemQuantityDiscountDetailControl.
The following is the markup for this control.
Developer's Note:
To create a custom version of the control, copy all of the code below into a file of the same name and place it into your Site's control folder (e.g., ../YourSiteFolder/Control). The CyberStore page engine will then override the default markup with your customized version.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CatalogItemQuantityDiscountDetailControl.ascx.cs"
Inherits="Dovetail.Ecommerce.Controls.CatalogItemQuantityDiscountDetailControl" >
<@ Register TagPrefix="uc1" TagName="CatalogItemImageControl" Src="~/Control/CatalogItemImageControl.ascx" >
<@ Register TagPrefix="uc1" TagName="CatalogItemQuantityDiscountDisplay" Src="~/Control/CatalogItemQuantityDiscountDisplay.ascx" >
<@ Register TagPrefix="uc1" TagName="CatalogOnHandQuantityDisplayControl" Src="~/Control/CatalogOnHandQuantityDisplayControl.ascx" >
<@ Register TagPrefix="uc1" TagName="CatalogPricingControl" Src="~/Control/CatalogPricingControl.ascx" >
<@ Register TagPrefix="uc1" TagName="CatalogItemListingByCategoryControl" Src="~/Control/CatalogItemListingByCategoryControl.ascx" >
<@ Import Namespace="Dovetail.Ecommerce.Base.Module" %>
<span class="">
<%# String.Format("<a class=\"CatalogDetailNavTrailCategory\" href=\"CatalogSubCategoryDisplay.aspx?CID={0}\">{1}</a>",Category_IDstr,CatNamestr) %>
<b>>></b> <span class="CatalogDetailNavTrailItemName">
<%# ItemNamestr %>
</span></span>
<table border="0" class="ItemQuantityDiscountDetailTable">
<tr>
<td valign="top">
<p class="CatalogProductDetailHeadline">
<%# HeadLinestr%>
</p>
<p class="CatalogProductDetailSubHeadline">
<%# SubHeadlinestr%>
</p>
<p class="CatalogProductDetailDetail">
<%# LongDescriptionstr%>
</p>
</td>
<td>
<uc1:CatalogItemImageControl ID="ImageControl" PhotoCssClass="CatalogProductDetailPicture"
PictureNotFoundCssClass="CatalogProductDetailPictureNotFound" PhotoAltText='<%# HeadLinestr%>'
StockCode='<%# StockCodestr%>' PhotoLocation='<%# UsePhoto%>' PhotoWidth='<#PhotoWidth>'
Align="right" runat="server" />
</td>
</tr>
</table>
<br clear="all">
<uc1:CatalogItemListingByCategoryControl ID="CatalogItemListing" runat="server" />
<asp:DataGrid ID="ListingGrid" runat="server" CssClass="DefaultTable" AutoGenerateColumns="false"
AlternatingItemStyle-CssClass="HighlightTableRow" HeaderStyle-CssClass="HighlightTableRow"
BorderWidth="0px" ShowFooter="true" ShowHeader="true" BorderStyle="Solid" ItemStyle-CssClass="ItemByCategoryListingRow"
AlternatingItemStyle-CssClas="ItemByCategoryListingRow">
<AlternatingItemStyle CssClass="ItemByCategoryListingHighlightRow"></AlternatingItemStyle>
<HeaderStyle CssClass="ItemListingHeader"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Stock Code" ItemStyle-CssClass="ItemListingStockCodeCol">
<ItemTemplate>
<%# String.Format("<a class=\"CatalogListNavTrail\" href=\"{0}\">{1}</a>", Dovetail.Ecommerce.BusinessLogic.Catalog.FriendlyUrl.CategoryItemDetailPage(DataBinder.Eval(Container.DataItem, "StockCode").ToString(), DataBinder.Eval(Container.DataItem, "ItemName").ToString(), Dovetail.Ecommerce.Module.Catalog.Instance.Category_ID), DataBinder.Eval(Container.DataItem, "StockCode"))%>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Name" ItemStyle-CssClass="ItemListingNameCol">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<%# String.Format("<a class=\"CatalogListNavTrail\" href=\"{0}\">{1}</a>", Dovetail.Ecommerce.BusinessLogic.Catalog.FriendlyUrl.CategoryItemDetailPage(DataBinder.Eval(Container.DataItem, "StockCode").ToString(), DataBinder.Eval(Container.DataItem, "ItemName").ToString(), Dovetail.Ecommerce.Module.Catalog.Instance.Category_ID), DataBinder.Eval(Container.DataItem, "ItemName"))%>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Description" ItemStyle-CssClass="ItemListingDescriptionCol">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "ShortDescription")%></ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Qty in Stock" ItemStyle-CssClass="ItemListingQtyinStockCol">
<HeaderStyle />
<ItemTemplate>
<uc1:CatalogOnHandQuantityDisplayControl ID="OnHandQuantityDisplay" runat="server"
Item_ID='<%# DataBinder.Eval(Container.DataItem, "Item_ID") %>' OnHandDisplayCssClass="OnHandQuantityItemVerticleListings"
LimitedUnavaliableMessage="[QTY] [UOM]" OnHandDisplayMessage="[QTY] [UOM]" LimitedAvailableMessage="[QTY] [UOM]"
UnlimitedAvailableMessage="[QTY] [UOM]" UnlimitedUnavailableMessage="[QTY] [UOM]"
EnableLeadTimeMessage="false" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Order Qty Price/Unit">
<ItemTemplate>
<uc1:CatalogAddtoCartButton ID="CatalogaddtocartInput" runat="server" Item_ID='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem, "Item_ID"))%>'
ButtonCss="CatalogProductVerticalListButton" AccButtonCss="CatalogAccessoryAddButton"
DisplayMode="multiaddinput" />
</ItemTemplate>
<FooterTemplate>
<uc1:CatalogPricingControl ID="Catalogaddtocartbutton1" runat="server" Item_ID='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem, "Item_ID"))%>'
DisplayMode="multiaddbutton" />
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<p class="CatalogProductDetailQtyPricing">
<uc1:CatalogItemQuantityDiscountDisplay ID="CatalogItemQuantityDiscountDisplay1"
runat="server" />
</p>