コード例 #1
0
    /// <summary>
    /// Deletes checkout process step. Called when the "Delete step" button is pressed.
    /// Expects the CreateCheckoutProcessStep method to be run first.
    /// </summary>
    private bool DeleteCheckoutProcessStep()
    {
        // Create new checkout process
        CheckoutProcessInfo checkoutProcess = new CheckoutProcessInfo();

        // Load checkout process xml definition
        checkoutProcess.LoadXmlDefinition(ECommerceSettings.CheckoutProcess(CMSContext.CurrentSiteName));

        // Get 'My new step' checkout process step
        CheckoutProcessStepInfo deleteStep = checkoutProcess.GetCheckoutProcessStepInfo("MyNewStep");

        if (deleteStep != null)
        {
            // Delete the step
            checkoutProcess.RemoveCheckoutProcessStepNode("MyNewStep");

            // Save the data
            SettingsKeyProvider.SetValue(CMSContext.CurrentSiteName + "." + ECommerceSettings.CHECKOUT_PROCESS, checkoutProcess.GetXmlDefinition());

            return true;
        }

        return false;
    }