disable steps in checkout

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
hi whats the best way of disabling some steps during checkout like selecting billing address, shiping method and payment method. The site is for a b2b scenario and we dont need the aforementioned steps.

Any help is appreciated.
14 years ago
I would like to also take advantage of this type of feature and have the steps shown on the checkout page

All I need is
Shipping address and Confirm checkout

No Need for Payment, Billing or Shipping as all shipments go ground and payment is pre approved.

Thanks
14 years ago
You'll need a bit of code rewritting to do that. I have just finished removing checkout steps from the eStore we are going to launch.

You'll basically have to add a "default addresses" functionality in order to set billing and shipping address on every checkout. It's not a trivial process but can be easily be done if you know how to get your way around with ASP.NET and C#.
14 years ago
Milasch  can you direct us a bit on how you achieved that, i think that many others will benefit as well!
14 years ago
Do you program in ASP.NET/C#?
14 years ago
Hello

Yes milaschI need to know that too

Please help

I'm using vb 2008
14 years ago
Hi milasch,

I want to see your approach too. See this as a whitelist for us, we would really appreciate your code.

Thanks
14 years ago
I disable the selection of shipping method. I only have one shipping method defined in the system. In the module CheckoutShippingMethod.ascx I check to make sure there is only one shipping method defined. I then automatically assign the first shipping method and the redirect to the next step. The code shown below is from the Page_Load. The user never sees the shipping method selection screen. I am sure if you wanted to skip other steps it would be similar.


            if (!Page.IsPostBack)
            {
                if (shoppingCartRequiresShipping)
                {
                    //ShipmentPackage shipmentPackage = ShippingManager.CreateShipmentPackage(Cart, NopContext.Current.User.ShippingAddress);
                    string error = string.Empty;
                    ShippingOptionCollection shippingOptions = ShippingManager.GetShippingOptions(Cart, NopContext.Current.User, NopContext.Current.User.ShippingAddress, ref error);
                    if (!String.IsNullOrEmpty(error))
                    {
                        LogManager.InsertLog(LogTypeEnum.ShippingErrror, error, error);
                        lError.Text = Server.HtmlEncode(error);
                    }
                    else
                    {
                        if (shippingOptions.Count == 1)
                        {
                            NopContext.Current.User.LastShippingOption = shippingOptions[0];
                            Response.Redirect("~/CheckoutPaymentMethod.aspx");
                        }
                        if (shippingOptions.Count > 0)
                        {
                            dlShippingOptions.DataSource = shippingOptions;
                            dlShippingOptions.DataBind();
                        }
                        else
                        {
                            phSelectShippingMethod.Visible = false;
                            phShippingIsNotAllowed.Visible = true;
                        }
                    }
                }



I hope this helps.
Tod
14 years ago
Works wonderfully, i ll try to follow your example and disable the other steps as well, and post it here.

One more question, how do i remove the Shipping Method  field from the message templates and from the order overview.

thanxs
14 years ago
Hi,
managed to disable payment info, its the same principal as above, just make only one payment method as default and in the load event of  checkoutpaymentinfo.ascx.cs append the two lines


 protected void Page_Load(object sender, EventArgs e)
        {
            this.ApplyLocalization();

            if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !NopContext.Current.AnonymousCheckoutAllowed))
            {
                string loginURL = CommonHelper.GetLoginPageURL(true);
                Response.Redirect(loginURL);
            }

            Cart = ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart);
            if (Cart.Count == 0)
                Response.Redirect("~/ShoppingCart.aspx");
            OrderSummaryControl.BindData();

           /////panos edit to skip payment info-takes default one!
            this.PaymentInfo = this.GetPaymentInfo();
            Response.Redirect("~/CheckoutConfirm.aspx");
           /////////////////////////////////////

        }


I am having dificulties on billing address though, if someone can help us will be great!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.