protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        if (SKUID > 0)
        {
            InitializeControls();

            if (!mDataLoaded)
            {
                ReloadData();
            }
            // Set visibility for horizontal line (separator) between stock and selectors
            pnlSeparator.Visible = ShowProductOptions && SKUHasOptions;

            // Get count of the product options
            if (ShowTotalPrice && SKUHasOptions)
            {
                // Count and show total price with options
                CalculateTotalPrice();

                // Use default label
                lblPrice.Text = GetString("ShoppingCartItemSelector.TotalPrice");

                pnlPrice.Visible = true;
            }
            else
            {
                // Hide total price container
                pnlPrice.Visible = false;
            }

            if (DialogMode)
            {
                pnlButton.CssClass += " PageFooterLine";
            }
        }

        hdnSKUID.Value = SKUID.ToString();

        // Show panel only when some selectors loaded
        pnlSelectors.Visible = ShowProductOptions && SKUHasOptions;

        if (pnlSelectors.Visible)
        {
            SetDisabledProductOptions();
        }
    }
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        if (SKUID > 0)
        {
            InitializeControls();

            if (!mDataLoaded)
            {
                ReloadData();
            }
            // Set visibility for horizontal line (separator) between stock and selectors
            pnlSeparator.Visible = ShowProductOptions && SKUHasOptions;

            if (StockVisible)
            {
                SetStockInformation();
                lblStock.Text    = GetString("com.shoppingcartitemselector.stock");
                pnlStock.Visible = true;
            }

            // Get count of the product options
            if (AlwaysShowTotalPrice || (ShowTotalPrice && SKUHasOptions))
            {
                // Count and show total price with options
                CalculateTotalPrice();
                // Show info message if selected variant is invalid
                EnsureUnavailableVariantMessage();

                if (!string.IsNullOrEmpty(TotalPriceLabel))
                {
                    // Use custom label
                    lblPrice.Text = GetString(TotalPriceLabel);
                }
                else
                {
                    // Use default label
                    lblPrice.Text = GetString("ShoppingCartItemSelector.TotalPrice");
                }

                pnlPrice.Visible = true;
            }
            else
            {
                // Hide total price container
                pnlPrice.Visible = false;
            }

            if (DialogMode)
            {
                pnlButton.CssClass += " PageFooterLine";
            }
        }

        hdnSKUID.Value = SKUID.ToString();

        // Show panel only when some selectors loaded
        pnlSelectors.Visible = ShowProductOptions && SKUHasOptions;

        if (pnlSelectors.Visible)
        {
            SetDisabledProductOptions();
        }
    }