disable steps in checkout

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
15 anni tempo fa
for anyone still having trouble or reading this thread for advice...


The way I got around this was simple...

I had one payment method, which I set as "checked" in the aspx file...  then copied the C# instructions from btn_click and put them at the bottom of page_load...

This essentially means the box is automatically selected, and the button's click instructions are executed on page load...


Did the same for the payment info page... put the btn_click code under page_load


hope this helps somebody!
14 anni tempo fa
Is this being planned for a future NOP release?  I have tried the other methods outlined in here but nothing is working.
14 anni tempo fa
Hi,

Here's a real clean way to disable the shipping address altogether. However, be aware that I haven't tested it through credit card processing. To tell you the truth, I'm not really sure it should make a difference at all. To my understanding, the credit card processor is interested more in the billing address. After all, we can use any ship to address when we buy online...

Find Line 367 in the Shipping Manager (NopCommerce, Nop.BusinessLogic, Shipping, Shipping Manager for Version 1.8) and comment out the following lines...

        public static bool ShoppingCartRequiresShipping(ShoppingCart cart)
        {

            //PCTech Mod
            //foreach (var shoppingCartItem in cart)
            //    if (shoppingCartItem.IsShipEnabled)
            //        return true;

            return false;
        }

This makes it so that no items require shipping at all, which is great for those who do electronic delivery, subscriptions (for the membership sites...you get the picture.

Once I'm ready to test, I'll post again and let you all know how it goes. If anyone beats me to it, I would love to hear how it goes...

Jose
14 anni tempo fa
this is not working with 1.90.
any idea
13 anni tempo fa
Found the solution here

http://jugaadtech.in/13/skip-steps-in-checkout-in-nopcommerce]http://jugaadtech.in/13/skip-steps-in-checkout-in-nopcommerce

It may help somebody ;-)
13 anni tempo fa
Instead of changing source code, you can skip this step changing your products variant.

Go to Catalog > Products > Manage Products

Then Edit a product.

Go to Variants and Modify it (create it if it does not exist).

Uncheck "Possible delivery".

Do it for all your products and you are done.

PS: If you have a lot of products you can save time modifying it directly through the database.
13 anni tempo fa
I also needed some changes to payment steps. I amended it to be only three steps: 1)Cart 2)Confirm 3)Complete.
So, what I did. I have amended the Presentation/Nop.Web/Controllers/CheckoutController.cs and Presentation/Nop.Web/Views/Checkout/CheckoutProgress.cshtml, I skip billing address, shipping address and payment steps and set them to default values(payment method 'Cash On Delivery' should be active). Unfortunately, I could not attach file to this topic, so ask me on [email protected], I'll send to files or see short code snap below. Then you can take experiment and replace files and rebuild solution.(Attention do backup before make changes!!!)

Amendments in CheckoutProgress.cshtml (just comment added):


      
@*<li>
            <a @(Model.CheckoutProgressStep == CheckoutProgressStep.Address ? " class=active-step" : " class=inactive-step") @(Model.CheckoutProgressStep != CheckoutProgressStep.Cart && Model.CheckoutProgressStep != CheckoutProgressStep.Complete ? " href=" + Url.RouteUrl("CheckoutBillingAddress") : null)>@T("Checkout.Progress.Address")</a>
        </li>
        <li>
            <a @(Model.CheckoutProgressStep == CheckoutProgressStep.Shipping ? " class=active-step" : " class=inactive-step") @(Model.CheckoutProgressStep != CheckoutProgressStep.Cart && Model.CheckoutProgressStep != CheckoutProgressStep.Address && Model.CheckoutProgressStep != CheckoutProgressStep.Complete ? " href=" + Url.RouteUrl("CheckoutShippingMethod") : null)>@T("Checkout.Progress.Shipping")</a>
        </li>
        <li><a @(Model.CheckoutProgressStep == CheckoutProgressStep.Payment ? " class=active-step" : " class=inactive-step") @(Model.CheckoutProgressStep != CheckoutProgressStep.Cart && Model.CheckoutProgressStep != CheckoutProgressStep.Address && Model.CheckoutProgressStep != CheckoutProgressStep.Shipping && Model.CheckoutProgressStep != CheckoutProgressStep.Complete ? " href=" + Url.RouteUrl("CheckoutPaymentMethod") : null)>@T("Checkout.Progress.Payment")</a>
        </li>*@


Amendments in  CheckoutController.cs:
Add new method


private void SkipSteps()
        {
            //SET DEFAULT BILLING ADDRESS
            var defaultBillingAddress = _workContext.CurrentCustomer.Addresses.FirstOrDefault();
            if (defaultBillingAddress == null)
            {
                defaultBillingAddress = new Address()
                                            {
                                                Address1 = string.Empty,
                                                Address2 = string.Empty,
                                                City = string.Empty,
                                                Company = string.Empty,
                                                FirstName = _workContext.CurrentCustomer.Username,
                                                LastName = string.Empty,
                                                Email = _workContext.CurrentCustomer.Email,
                                                StateProvinceId = 1,
                                                CountryId = 1,
                                                ZipPostalCode = "00000",
                                                PhoneNumber = "00000",
                                                FaxNumber = "00000",
                                                Country = _countryService.GetCountryById(1),
                                                CreatedOnUtc = DateTime.UtcNow,
                                                Id=0
                                            };
                _workContext.CurrentCustomer.AddAddress(defaultBillingAddress);
            }

            _workContext.CurrentCustomer.SetBillingAddress(defaultBillingAddress);
            _workContext.CurrentCustomer.SetShippingAddress(defaultBillingAddress);

            //SET DEFAULT PAYMENT TYPE
            var p = new ProcessPaymentRequest() { PaymentMethodSystemName = "Payments.CashOnDelivery" };
            _workContext.CurrentCustomer.SelectedPaymentMethodSystemName = "Payments.CashOnDelivery";
            _httpContext.Session["OrderPaymentInfo"] = p;
            _customerService.UpdateCustomer(_workContext.CurrentCustomer);
        }
Then replace
return RedirectToRoute("CheckoutBillingAddress");(line 336)
with
SkipSteps();
return RedirectToRoute("CheckoutConfirm");
//return RedirectToRoute("CheckoutBillingAddress");
return null;
12 anni tempo fa
*Goldcoding - That was exactly what I've been trying to do for the last few hours.  So glad you figured it out and posted a sample for it.  I really appreciated it.
9 anni tempo fa
hi,
i am new in entity framework and i customize nopcommerce project for travel domain but i am facing lots of problem can you help me how to follow nopcommerce  structure in correct way.
8 anni tempo fa
bhagwat wrote:
hi,
i am new in entity framework and i customize nopcommerce project for travel domain but i am facing lots of problem can you help me how to follow nopcommerce  structure in correct way.


Hi,

please take a look: Developer tutorials
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.