nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.31k stars 5.33k forks source link

Allow a store owner to disable "Billing address" for guests #1954

Closed ArturAlekseev closed 1 year ago

ArturAlekseev commented 7 years ago

It's a common need to disable it (especially for Russia where people do not know what is it - billing address). Or just make this option to also work for guests. Also nearly in all cases we do not need it. We get payment online and only need shipping address where to send products. No one gets payment (not online) at billing address and/or sends there any documents.

But in order to implement it we have to finish task - https://github.com/nopSolutions/nopCommerce/issues/40. Once it's done it'll quite easy to hide billing address and still having opportunity to have "rich" shipping address

Similar issue is explained at https://github.com/nopSolutions/nopCommerce/issues/997 - But I think fix is wrong there.

Also see original work item description in comments

AndreiMaz commented 7 years ago

@ArturAlekseev Thanks! But according to this option description (hint in admin area) - "this option cannot be used with guest checkout enabled"

ArturAlekseev commented 7 years ago

Then there should be a second option for guests to disable billing address. It's a common need to disable it (especially for Russia where people do not know what is it - billing address). Or just make this option to also work for guests. Also nearly in all cases we do not need it. We get payment online and only need shipping address where to send products. No one gets payment (not online) at billing address and/or sends there any documents.

AndreiMaz commented 7 years ago

ORIGINAL POST:

v3.80 Problem: If DisableBillingAddressCheckoutStep = true then if unregistered user is checking out order and does not have any addresses added he/she gets Billing Address form. What should be fixed: In public ActionResult BillingAddress(FormCollection form)

//check whether "billing address" step is enabled
            if (_orderSettings.DisableBillingAddressCheckoutStep)
                return RedirectToRoute("CheckoutShippingAddress");

^^ just redirect to Shipping Address if Billing is disabled

in public ActionResult SelectShippingAddress(int addressId)

_workContext.CurrentCustomer.ShippingAddress = address;

            if (_orderSettings.DisableBillingAddressCheckoutStep)
                _workContext.CurrentCustomer.BillingAddress = address;

Set billing address same as shipping.

in public ActionResult NewShippingAddress(CheckoutShippingAddressModel model, FormCollection form)

same:

_workContext.CurrentCustomer.ShippingAddress = address;
                if (_orderSettings.DisableBillingAddressCheckoutStep)
                    _workContext.CurrentCustomer.BillingAddress = address;

Same issue is explained here: https://github.com/nopSolutions/nopCommerce/issues/997 But I think fix is wrong there.

AndreiMaz commented 7 years ago

@ArturAlekseev Thanks! I've just updated the task description. Please note reference to #40

P.S. Спасибо

AndreiMaz commented 7 years ago

Actially in the latest version we have "Ship to the same address" checkbox on the "Billing address" step. It's enab;eby default. A store owner can simply rename this field to "Address". So we'll have a "Address" only.

Regarding "Ship to the same address" checkbox. We can simply hide this option (but it'll be checked). So "Shipping address" step is always hidden. Just let's think how to better implement it

ArturAlekseev commented 5 years ago

In 4.10 this issue is still persist. If user does not have any addresses BillingAddress form is shown. Why you don't implement it as I'v shown before? _orderSettings.DisableBillingAddressCheckoutStep means that this form should be skipped in all cases.

In my example we just skip it and set billing address same as shipping when shipping address is selected.

RomanovM commented 1 year ago

After some consideration we've decided not to implement this functionality out of the box and leave it for customization.