nopSolutions/nopCommerce · error · Exception

Pickup point is not allowed

Error message

Pickup point is not allowed

What it means

Thrown in ParsePickupOptionAsync during checkout when the pickup-point selector cannot match the submitted option. The form value 'pickup-points-id' is split into provider key and point id; GetPickupPointsAsync is called and the result is filtered for a point whose Id equals pickupPoint[0]. If none matches, a bare Exception is thrown, meaning the chosen pickup point is not in the returned set (provider returned nothing, point deactivated, or malformed form value).

Source

Thrown at src/Presentation/Nop.Web/Controllers/CheckoutController.cs:188

    /// </summary>
    /// <param name="cart">Shopping Cart</param>
    /// <param name="form">The form</param>
    /// <returns>
    /// The task result contains the pickup option
    /// </returns>
    protected virtual async Task<PickupPoint> ParsePickupOptionAsync(IList<ShoppingCartItem> cart, IFormCollection form)
    {
        var pickupPoint = form["pickup-points-id"].ToString().Split(_separator, StringSplitOptions.None);

        var customer = await _workContext.GetCurrentCustomerAsync();
        var store = await _storeContext.GetCurrentStoreAsync();
        var address = customer.BillingAddressId.HasValue
            ? await _addressService.GetAddressByIdAsync(customer.BillingAddressId.Value)
            : null;

        var selectedPoint = (await _shippingService.GetPickupPointsAsync(cart, address,
                                customer, pickupPoint[1], store.Id)).PickupPoints.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]))
                            ?? throw new Exception("Pickup point is not allowed");

        return selectedPoint;
    }

    /// <summary>
    /// Saves the pickup option
    /// </summary>
    /// <param name="pickupPoint">The pickup option</param>
    protected virtual async Task SavePickupOptionAsync(PickupPoint pickupPoint)
    {
        var name = !string.IsNullOrEmpty(pickupPoint.Name) ?
            string.Format(await _localizationService.GetResourceAsync("Checkout.PickupPoints.Name"), pickupPoint.Name) :
            await _localizationService.GetResourceAsync("Checkout.PickupPoints.NullName");
        var pickUpInStoreShippingOption = new ShippingOption
        {
            Name = name,
            Rate = pickupPoint.PickupFee,
            Description = pickupPoint.Description,

View on GitHub (pinned to 64bdf2ff08)

Solutions

  1. Verify the pickup-point provider plugin is installed, active, and returning points for the customer's address.
  2. Ensure the pickup-points-id form value is well-formed (contains both point id and provider key separated by the separator).
  3. Re-select a currently-available pickup point on the checkout page.
  4. Catch the exception and return a localized 'pickup point unavailable, please choose another' JSON instead of crashing checkout.

Example fix

// before
var selectedPoint = (await _shippingService.GetPickupPointsAsync(cart, address,
    customer, pickupPoint[1], store.Id)).PickupPoints.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]))
    ?? throw new Exception("Pickup point is not allowed");
// after (graceful message)
var points = (await _shippingService.GetPickupPointsAsync(cart, address,
    customer, pickupPoint[1], store.Id)).PickupPoints;
var selectedPoint = points.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]));
if (selectedPoint is null)
    throw new Exception(await _localizationService.GetResourceAsync("Checkout.PickupPointNotAllowed"));
Defensive patterns

Strategy: validation

Validate before calling

// Validate the chosen pickup point is still in the returned set.
var points = (await _shippingService.GetPickupPointsAsync(cart, address, customer, pickupPoint[1], store.Id)).PickupPoints;
var selectedPoint = points.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]));
if (selectedPoint is null)
    return Json(new { error = 1, message = "Selected pickup point is no longer available." });

Type guard

static bool PickupPointAvailable(PickupPoint p) => p is not null;

Try / catch

try { /* ParsePickupOptionAsync body */ }
catch (Exception ex) when (ex.Message == "Pickup point is not allowed")
{
    return Json(new { error = 1, message = ex.Message });
}

Prevention

When it happens

Trigger: Customer selects a pickup point but by the time checkout processes it, shipping.GetPickupPointsAsync either returns no points for that provider/address or none with the matching Id. Causes: pickup point deactivated, provider error, address changed so the point list differs, or a tampered/malformed pickup-points-id form value.

Common situations: Pickup provider (e.g., a shipping plugin) is down or misconfigured and returns an empty list; pickup point disabled between selection and confirmation; address change re-fetches a different point set; multi-store/provider routing mismatch; form value split fails (fewer than 2 segments).

Related errors


AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13). Data as JSON: /api/errors/eea8867edc396f1e. Report an issue: GitHub.