You can expand on the Restricted blog example above. I.e. have multiple categories like "Restricted for City ABC", "Restricted for City XYZ", etc.
To use City rather than Country, just use ShippingAddress.City = "Some City Name"
e.g. ... something like this ...
ErrorExit
Restricted for ABC
ShippingAddress.City = "ABC" and Items.Any([@categories].Any(Category.Name = "Restricted for ABC"))
"Sorry, we cant ship "
+ Items.First([@categories].Where(Category.Name = "Restricted for ABC")).ProductVariant.Product.Name
+ " to ABC"
ErrorExit
Restricted for XYZ
ShippingAddress.City = "XYZ" and Items.Any([@categories].Any(Category.Name = "Restricted for XYZ")) + " to XYZ"
"Sorry, we cant ship " +
+ Items.First([@categories].Where(Category.Name = "Restricted for ABC")).ProductVariant.Product.Name
(line breaks added above for readability. Also, some additional vars and refs can be added to shorten it)
Note that if any items in the cart are restricted, the entire cart must be rejected. There is no way in nopC (currently :) to create separate shipments in the checkout process