Any way to hide the shipping method step from one page checkout

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 年 前
Hi,

I am using nopcommerce 3.20 source,

is there any way to hide the shipping method step and just go straight from the shipping address to payment method,

i only offer one shipping method so it is pointless the customer seeing this step,
10 年 前
Go to admin area > configuration > settings > shipping settings > tick "Bypass shipping method page if there's only one"
3 年 前
Hi,

I have only one shipping method and I have ticked "Bypass shipping method page if there's only one" option but it has not made a difference.

I still have to click continue on the Shipping Method step on One Page Checkout.
Im using Nop 4.2.

Any ideas?
3 年 前
Do you have Visual Studio and can you set a breakpoint at the bolded section of the CheckoutController?


        protected virtual JsonResult OpcLoadStepAfterShippingAddress(IList<ShoppingCartItem> cart)
        {
            var shippingMethodModel = _checkoutModelFactory.PrepareShippingMethodModel(cart, _workContext.CurrentCustomer.ShippingAddress);
            if (_shippingSettings.BypassShippingMethodSelectionIfOnlyOne &&
                shippingMethodModel.ShippingMethods.Count == 1)

            {
                //if we have only one shipping method, then a customer doesn't have to choose a shipping method
                _genericAttributeService.SaveAttribute(_workContext.CurrentCustomer,
                    NopCustomerDefaults.SelectedShippingOptionAttribute,
                    shippingMethodModel.ShippingMethods.First().ShippingOption,
                    _storeContext.CurrentStore.Id);

                //load next step
                return OpcLoadStepAfterShippingMethod(cart);
            }

            return Json(new
            {
                update_section = new UpdateSectionJsonModel
                {
                    name = "shipping-method",
                    html = RenderPartialViewToString("OpcShippingMethods", shippingMethodModel)
                },
                goto_section = "shipping_method"
            });
        }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.