Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public static partial class NopCustomerDefaults
/// </summary>
public static string SelectedPaymentMethodAttribute => "SelectedPaymentMethod";

public static string ShipToSameAddressAttribute => "ShipToSameAddress";

/// <summary>
/// Gets a name of generic attribute to store the value of 'SelectedShippingOption'
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Libraries/Nop.Core/Domain/Orders/OrderSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public partial class OrderSettings : ISettings
/// </summary>
public bool OnePageCheckoutEnabled { get; set; }

public bool SinglePageCheckoutEnabled { get; set; }

/// <summary>
/// Gets or sets a value indicating whether order totals should be displayed on 'Payment info' tab of 'One-page checkout' page
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Libraries/Nop.Core/Http/NopRouteNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public static partial class Standard
/// </summary>
public const string CHECKOUT_ONE_PAGE = "CheckoutOnePage";

public const string CHECKOUT_SINGLE_PAGE = "CheckoutSinglePage";

/// <summary>
/// Gets the checkout shipping address route name
/// </summary>
Expand Down
6 changes: 5 additions & 1 deletion src/Presentation/Nop.Web/Controllers/CheckoutController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Nop.Core.Domain.Payments;
using Nop.Core.Domain.Security;
using Nop.Core.Domain.Shipping;
using Nop.Core.Domain.Stores;
using Nop.Core.Domain.Tax;
using Nop.Core.Http;
using Nop.Services.Attributes;
Expand Down Expand Up @@ -382,6 +383,9 @@ public virtual async Task<IActionResult> Index()
if (_orderSettings.OnePageCheckoutEnabled)
return RedirectToRoute(NopRouteNames.Standard.CHECKOUT_ONE_PAGE);

if (_orderSettings.SinglePageCheckoutEnabled)
return RedirectToRoute(NopRouteNames.Standard.CHECKOUT_SINGLE_PAGE);

return RedirectToRoute(NopRouteNames.Standard.CHECKOUT_BILLING_ADDRESS);
}

Expand Down Expand Up @@ -1723,7 +1727,7 @@ await _checkoutModelFactory.PrepareShippingAddressModelAsync(shippingAddressMode
.Select(p => p.ErrorMessage))
});
}

//try to find an address with the same values (don't duplicate records)
var address = _addressService.FindAddress((await _customerService.GetAddressesByCustomerIdAsync(customer.Id)).ToList(),
newAddress.FirstName, newAddress.LastName, newAddress.PhoneNumber,
Expand Down
Loading