{"record":{"id":"eea8867edc396f1e","repo":"nopSolutions/nopCommerce","slug":"pickup-point-is-not-allowed","errorCode":null,"errorMessage":"Pickup point is not allowed","messagePattern":"Pickup point is not allowed","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Controllers/CheckoutController.cs","lineNumber":188,"sourceCode":"    /// </summary>\r\n    /// <param name=\"cart\">Shopping Cart</param>\r\n    /// <param name=\"form\">The form</param>\r\n    /// <returns>\r\n    /// The task result contains the pickup option\r\n    /// </returns>\r\n    protected virtual async Task<PickupPoint> ParsePickupOptionAsync(IList<ShoppingCartItem> cart, IFormCollection form)\r\n    {\r\n        var pickupPoint = form[\"pickup-points-id\"].ToString().Split(_separator, StringSplitOptions.None);\r\n\r\n        var customer = await _workContext.GetCurrentCustomerAsync();\r\n        var store = await _storeContext.GetCurrentStoreAsync();\r\n        var address = customer.BillingAddressId.HasValue\r\n            ? await _addressService.GetAddressByIdAsync(customer.BillingAddressId.Value)\r\n            : null;\r\n\r\n        var selectedPoint = (await _shippingService.GetPickupPointsAsync(cart, address,\r\n                                customer, pickupPoint[1], store.Id)).PickupPoints.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]))\r\n                            ?? throw new Exception(\"Pickup point is not allowed\");\r\n\r\n        return selectedPoint;\r\n    }\r\n\r\n    /// <summary>\r\n    /// Saves the pickup option\r\n    /// </summary>\r\n    /// <param name=\"pickupPoint\">The pickup option</param>\r\n    protected virtual async Task SavePickupOptionAsync(PickupPoint pickupPoint)\r\n    {\r\n        var name = !string.IsNullOrEmpty(pickupPoint.Name) ?\r\n            string.Format(await _localizationService.GetResourceAsync(\"Checkout.PickupPoints.Name\"), pickupPoint.Name) :\r\n            await _localizationService.GetResourceAsync(\"Checkout.PickupPoints.NullName\");\r\n        var pickUpInStoreShippingOption = new ShippingOption\r\n        {\r\n            Name = name,\r\n            Rate = pickupPoint.PickupFee,\r\n            Description = pickupPoint.Description,\r","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Controllers/CheckoutController.cs#L170-L206","documentation":"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).","triggerScenarios":"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.","commonSituations":"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).","solutions":["Verify the pickup-point provider plugin is installed, active, and returning points for the customer's address.","Ensure the pickup-points-id form value is well-formed (contains both point id and provider key separated by the separator).","Re-select a currently-available pickup point on the checkout page.","Catch the exception and return a localized 'pickup point unavailable, please choose another' JSON instead of crashing checkout."],"exampleFix":"// before\nvar selectedPoint = (await _shippingService.GetPickupPointsAsync(cart, address,\n    customer, pickupPoint[1], store.Id)).PickupPoints.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]))\n    ?? throw new Exception(\"Pickup point is not allowed\");\n// after (graceful message)\nvar points = (await _shippingService.GetPickupPointsAsync(cart, address,\n    customer, pickupPoint[1], store.Id)).PickupPoints;\nvar selectedPoint = points.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]));\nif (selectedPoint is null)\n    throw new Exception(await _localizationService.GetResourceAsync(\"Checkout.PickupPointNotAllowed\"));","handlingStrategy":"validation","validationCode":"// Validate the chosen pickup point is still in the returned set.\nvar points = (await _shippingService.GetPickupPointsAsync(cart, address, customer, pickupPoint[1], store.Id)).PickupPoints;\nvar selectedPoint = points.FirstOrDefault(x => x.Id.Equals(pickupPoint[0]));\nif (selectedPoint is null)\n    return Json(new { error = 1, message = \"Selected pickup point is no longer available.\" });","typeGuard":"static bool PickupPointAvailable(PickupPoint p) => p is not null;","tryCatchPattern":"try { /* ParsePickupOptionAsync body */ }\ncatch (Exception ex) when (ex.Message == \"Pickup point is not allowed\")\n{\n    return Json(new { error = 1, message = ex.Message });\n}","preventionTips":["Keep the pickup provider plugin active and correctly configured for the store/address.","Ensure the pickup-points-id form value is well-formed (id + provider key).","Re-select a pickup point if the shipping address changes."],"tags":["nopcommerce","checkout","pickup-point","shipping","not-found","plugin"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}