{"record":{"id":"4c83deb337b7b9d6","repo":"nopSolutions/nopCommerce","slug":"country-shippingcountry-name-is-not-allowed-fo","errorCode":null,"errorMessage":"Country '{shippingCountry.Name}' is not allowed for shipping","messagePattern":"Country '(.+?)' is not allowed for shipping","errorType":"validation","errorClass":"NopException","httpStatus":null,"severity":"error","filePath":"src/Libraries/Nop.Services/Orders/OrderProcessingService.cs","lineNumber":464,"sourceCode":"                    ZipPostalCode = pickupPoint.ZipPostalCode,\r\n                    CreatedOnUtc = DateTime.UtcNow\r\n                };\r\n            }\r\n            else\r\n            {\r\n                if (details.Customer.ShippingAddressId == null)\r\n                    throw new NopException(\"Shipping address is not provided\");\r\n\r\n                var shippingAddress = await _customerService.GetCustomerShippingAddressAsync(details.Customer);\r\n\r\n                if (!CommonHelper.IsValidEmail(shippingAddress?.Email))\r\n                    throw new NopException(\"Email is not valid\");\r\n\r\n                //clone shipping address\r\n                details.ShippingAddress = _addressService.CloneAddress(shippingAddress);\r\n\r\n                if (await _countryService.GetCountryByAddressAsync(details.ShippingAddress) is Country shippingCountry && !shippingCountry.AllowsShipping)\r\n                    throw new NopException($\"Country '{shippingCountry.Name}' is not allowed for shipping\");\r\n            }\r\n\r\n            var shippingOption = await _genericAttributeService.GetAttributeAsync<ShippingOption>(details.Customer,\r\n                NopCustomerDefaults.SelectedShippingOptionAttribute, processPaymentRequest.StoreId);\r\n            if (shippingOption != null)\r\n            {\r\n                details.ShippingMethodName = shippingOption.Name;\r\n                details.ShippingRateComputationMethodSystemName = shippingOption.ShippingRateComputationMethodSystemName;\r\n            }\r\n\r\n            details.ShippingStatus = ShippingStatus.NotYetShipped;\r\n        }\r\n        else\r\n            details.ShippingStatus = ShippingStatus.ShippingNotRequired;\r\n    }\r\n\r\n    /// <summary>\r\n    /// Prepare and validate shopping cart and checkout attributes\r","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Libraries/Nop.Services/Orders/OrderProcessingService.cs#L446-L482","documentation":"Thrown when the country resolved from the shipping address has AllowsShipping=false, meaning the store is configured to not ship to that destination. This is a business-rule restriction enforced at order placement to prevent orders to unsupported regions.","triggerScenarios":"The customer's shipping address country is marked as 'not allowed for shipping' in Configuration > Countries. The country record was disabled for shipping after the customer selected their address but before order completion.","commonSituations":"Admin disabled shipping to a country (e.g. due to logistics constraints) but existing customer addresses still reference it. A newly created country record defaults to AllowsShipping=false and wasn't updated. International expansion where the new country wasn't enabled for shipping. A test/staging environment with all countries' shipping disabled.","solutions":["In admin (Configuration > Countries), enable 'Allows shipping' for the customer's destination country.","If shipping is intentionally blocked, inform the customer and offer alternative delivery or pickup options.","Add a checkout-time validation that filters shipping address countries by AllowsShipping to catch this before the payment step.","Audit country settings after any geographic policy change."],"exampleFix":"// before (admin): country.AllowsShipping = false\n// after: country.AllowsShipping = true;\nawait _countryService.UpdateCountryAsync(country);","handlingStrategy":"validation","validationCode":"// Before PlaceOrder, check if the shipping country allows shipping\nvar shippingAddress = await _customerService.GetCustomerShippingAddressAsync(customer);\nvar country = await _countryService.GetCountryByAddressAsync(shippingAddress);\nif (country != null && !country.AllowsShipping)\n{\n    _notificationService.ErrorNotification(\n        $\"We don't ship to {country.Name}. Please choose another address.\");\n    return RedirectToRoute(\"CheckoutShippingAddress\");\n}","typeGuard":"async Task<bool> CountryAllowsShippingAsync(ICountryService svc, Address addr)\n{\n    var c = await svc.GetCountryByAddressAsync(addr);\n    return c == null || c.AllowsShipping;\n}","tryCatchPattern":"try\n{\n    var result = await _orderProcessingService.PlaceOrderAsync(processPaymentRequest);\n}\ncatch (NopException ex) when (ex.Message.Contains(\"is not allowed for shipping\"))\n{\n    _notificationService.ErrorNotification(ex.Message);\n    return RedirectToRoute(\"CheckoutShippingAddress\");\n}","preventionTips":["Filter the shipping address country dropdown to only show countries where AllowsShipping=true.","When disabling shipping to a country, notify existing customers with addresses in that country.","Run periodic audits comparing customer shipping addresses against country shipping policy.","Add a shipping-step validation that blocks proceeding if the selected country doesn't allow shipping."],"tags":["nopcommerce","country","shipping-restriction","business-rule","order-processing"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}