/// <summary> /// Gets the next <see cref="ICheckoutCustomerManager"/>. /// </summary> /// <param name="current"> /// The current stage. /// </param> /// <returns> /// The <see cref="ICheckoutWorkflowMarker"/>. /// </returns> protected virtual ICheckoutWorkflowMarker GetNextCheckoutWorkflowMarker(CheckoutStage current) { ICheckoutWorkflowMarker workflowMarker = null; switch (current) { case CheckoutStage.BillingAddress: workflowMarker = new CheckoutWorkflowMarker { Previous = CheckoutStage.BillingAddress, Current = CheckoutStage.ShippingAddress, Next = CheckoutStage.ShipRateQuote }; break; case CheckoutStage.ShippingAddress: workflowMarker = new CheckoutWorkflowMarker { Previous = CheckoutStage.ShippingAddress, Current = CheckoutStage.ShipRateQuote, Next = CheckoutStage.PaymentMethod }; break; case CheckoutStage.ShipRateQuote: workflowMarker = new CheckoutWorkflowMarker { Previous = CheckoutStage.ShipRateQuote, Current = CheckoutStage.PaymentMethod, Next = CheckoutStage.Payment }; break; case CheckoutStage.PaymentMethod: workflowMarker = new CheckoutWorkflowMarker { Previous = CheckoutStage.PaymentMethod, Current = CheckoutStage.Payment, Next = CheckoutStage.None }; break; default: workflowMarker = new CheckoutWorkflowMarker(); break; } return(workflowMarker); }
/// <summary> /// Gets a checkout stage <see cref="IPublishedContent"/>. /// </summary> /// <param name="stage"> /// The stage. /// </param> /// <returns> /// The <see cref="IPublishedContent"/>. /// </returns> /// <remarks> /// The checkout stage is referenced on checkout pages as a custom property (Merchello Checkout Stage Picker) /// </remarks> public static IPublishedContent GetPageForStage(CheckoutStage stage) { var checkout = Content.GetCheckout(); if (stage == CheckoutStage.Custom || stage == CheckoutStage.None || !checkout.Children.Any()) return checkout; var stagePage = checkout.Children.FirstOrDefault( x => x.GetPropertyValue<string>("checkoutStage") .Equals(stage.ToString(), StringComparison.InvariantCultureIgnoreCase)); return stagePage ?? checkout; }
/// <summary> /// Gets a checkout stage <see cref="IPublishedContent"/>. /// </summary> /// <param name="stage"> /// The stage. /// </param> /// <returns> /// The <see cref="IPublishedContent"/>. /// </returns> /// <remarks> /// The checkout stage is referenced on checkout pages as a custom property (Merchello Checkout Stage Picker) /// </remarks> public static IPublishedContent GetPageForStage(CheckoutStage stage) { var checkout = Content.GetCheckout(); if (stage == CheckoutStage.Custom || stage == CheckoutStage.None || !checkout.Children.Any()) { return(checkout); } var stagePage = checkout.Children.FirstOrDefault( x => x.GetPropertyValue <string>("checkoutStage") .Equals(stage.ToString(), StringComparison.InvariantCultureIgnoreCase)); return(stagePage ?? checkout); }