Exemplo n.º 1
0
 /// <summary>
 /// Saves the custom preview fields.
 /// http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/modules/ecommerce/checkout/adding-custom-fields-to-the-checkout-widget/persisting-the-values-of-the-fields-in-the-cartorder-instance
 /// </summary>
 ///
 /// <param name="evt">The event.</param>
 public static void SaveCustomFields(IEcommerceCheckoutPageChangingEvent evt)
 {
     // Dyanmically save preview fields
     foreach (string name in GetCustomFields())
     {
         SaveCustomField(evt.ShoppingCartId, evt.Container, name);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Event triggered during e-commerce checkout.
        /// http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/modules/ecommerce/checkout/adding-custom-fields-to-the-checkout-widget/persisting-the-values-of-the-fields-in-the-cartorder-instance.
        /// </summary>
        ///
        /// <param name="checkoutPageChangingEvent">The event.</param>
        public static void PageChangingHandler(IEcommerceCheckoutPageChangingEvent checkoutPageChangingEvent)
        {
            // This event could be raised after the shopping cart was destroyed, so make sure you return when the ShoppingCartId is empty.
            if (checkoutPageChangingEvent.ShoppingCartId == Guid.Empty)
            {
                return;
            }

            // Determine checkout step
            switch (checkoutPageChangingEvent.CurrentStepIndex)
            {
            case PREVIEW_STEP:
                OrderHelper.SaveCustomFields(checkoutPageChangingEvent);
                break;
            }
        }