CyberStore Documentation
CatalogSimplePricingControl Class

Dovetail.Ecommerce.Controls Namespace : CatalogSimplePricingControl Class
A catalog simple pricing control. Introduced in v2.15.4.

The CatalogSimplePricingControl is an optimized PricingControl that is designed to display price information about and Item and provide for the ability to add the item to the Shopping Cart.


Use of the CatalogSimplePricingControl is intended to retrieve and display base pricing information for an Item. It is capable of displaying the Default Price, Customer Price, Discounted Price and Web Price pricing as well as the Savings Message and On Sale Graphic if desired. The control also includes an Add to Cart button and quantity input box which can quickly add Items in quantity to the Shopping Cart via client-side AJAX functions.

The CatalogSimplePricingControl does not include any of the advanced functions contained in the CatalogPricingControl such as tabbed display, accessory display, SKU selection, and quantity break price tables. This control is best suited for inclusion in controls based on the ListingControl base control where multiple Items are displayed.

Decisions on whether or not elements in the control are displayed is based on the CyberStore application's processing of central pricing display business rules which evaluate the state of the Item in context of the visitor, their Customer Class, various Site and system settings as well as the values of certain properties of the control. See the Access to Pricing topic for details about these pricing display rules.

Property Usage

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.

Properties Specific to CatalogSimplePricingControl

 The CatalogSimplePricingControl includes actions that are performed within the client browser using JavaScript. The functions used by the control are defined in the ClientJavaScript property. Website developers can override the standard functionality by altering the functions used by the control. To do so, modify the value of the ClientJavaScript property as needed.

Properties Inherited from the Base PricingControl 

The properties contained in the PricingControl base class can be grouped into the following types:

Binding Properties

Binding properties are used to establish the base data definition details about the child control.

The properties Item_ID and StockCode can be used to indicate which Item is being priced.

Behavioral Properties

Behavioral properties are used to control specific features or functions of the child control.

The property AddToCartMinimumQuantity (formerly MinimumRequired) forces the add to cart function to require a certain minimum order quantity in order to be successfully placed into the Shopping Cart.

The SavingsMessageCalcBasis property sets the basis for calculating the dollar and percent off amounts of the Savings Message. Available options are "Default" (default), and "Customer".

Some properties allow for specifying specific file paths for graphics used in a price. These are the AddToCartGraphicPath and OnSaleGraphicPath properties.

Visibility Properties

Visibility properties control whether some part of a child control's output should be shown or hidden.

To set the child control to only display price information (i.e. hide all other elements of the control like add to cart buttons, accessories, quantity price tables, etc.), set the ShowOnlyPricing property to true.

The following properties control the visibility of specific components of the price display: ShowOnSaleGraphicShowPricePerUnit, ShowSavingsMessage, and ShowUOM.

And finally, the ShowWebPrice property allows one to hide the CyberStore discount price from being displayed prior to the shopping cart by setting it to false.

Text Properties

Text properties allow one to change the default text for any of the elements available.

Child pricing controls all share the following properties for altering text: AddToCartButtonText sets the text inside the add to cart button.

Price labels can be altered using the DefaultPriceLabelText, CustomerPriceLabelTextDiscountPriceLabelText, and WebPriceLabelText properties.

Elements of the Savings Message part of a price display can be customized using the SavingsMessageLabelText and SavingsMessage properties.

The PricePerUnitDisplayText property is used to customize the text and form of the Price Per Unit part of pricing when used.

Style Properties

Style properties are used to allow for the adding of additional CSS classes into an element's HTML layout.

Available style properties shared among child pricing controls are:

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 IgnoreWhenModelIgnoreWhenSKU, 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

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 ComConfigUserData 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.


Control Markup

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="CatalogSimplePricingControl.ascx.cs"
    Inherits="Dovetail.Ecommerce.Controls.CatalogSimplePricingControl" %>

<div class="simplePricing">
    <div class="simplePricingRow"  id="divDefaultPrice" runat="server"> 
        <div class="label"><%= DefaultPriceLabelText %></div>
        <div class="<%= DefaultPriceCSSClass %>" ><%# Price.DefaultPrice %> 
            <span class="simpleUOM"><%# Price.UnitOfMeasureText %></span>
            <span class="simplePricePerUnit"><%# Price.DefaultPricePerUnit %></span>
    <div class="simplePricingRow"  id="divCustomerPrice" runat="server">
        <div class="label"><%= CustomerPriceLabelText %></div>
        <div class="<%= CustomerPriceCSSClass %>"><%# Price.CustomerPrice %> 
            <span class="simpleUOM"><%# Price.UnitOfMeasureText %></span>
            <span class="simplePricePerUnit"><%# Price.CustomerPricePerUnit %></span>
    <div class="simplePricingRow"  id="divDiscountPrice" runat="server">
        <div class="label"><%= DiscountPriceLabelText %></div>
        <div class="<%= DiscountPriceCSSClass %>" ><%# Price.DiscountPrice %> 
            <span class="simpleUOM"><%# Price.UnitOfMeasureText %></span>
            <span class="simplePricePerUnit"><%# Price.DiscountPricePerUnit %></span>
    <div class="simplePricingRow"  id="divSavingsMessage" runat="server" Visible="false">
        <div class="label"><%= SavingsMessageLabelText %></div>
        <div class="<%= SavingsMessageCSSClass %>" ><%= SavingsMessage %></div>
    <div><dx:ASPxImage ID="imgOnSaleGraphic" runat="server" Visible="false" /></div>

    <div class="simplePricingRow"  id="divWebPrice" runat="server">
        <div class="label"><%= WebPriceLabelText %></div>
        <div class="<%= WebDiscountedCSSClass %>" ><%# Price.WebPrice %> 
            <span class="simpleUOM"><%# Price.UnitOfMeasureText %></span>
            <span class="simplePricePerUnit"><%# Price.WebPricePerUnit %></span>
<input type="hidden" id="hfItem_ID" runat="server" />
<br />
<dx:ASPxPanel ID="pnlAddToCart" runat="server" DefaultButton="btnAddToCart" >
            <div class="simpleQTY" ><dx:ASPxTextBox ID="txtQty" runat="server" Caption="Qty"/></div>
            <div class="simpleBtn" ><dx:ASPxButton ID="btnAddToCart" runat="server" AutoPostBack="false" CssClass="btnCart" ClientEnabled="true"></dx:ASPxButton></div>

Inheritance Hierarchy


See Also


CatalogSimplePricingControl Members
Dovetail.Ecommerce.Controls Namespace