Delivery area check

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 anni tempo fa
Hello,

I am new in NopCommerce and I am using NopCommerce 2.65. I have doubt related to shipping settings.

My requirement is user will put his zip code and the system will tell if the store deliver to that area or not. Zip codes will be added from admin page.

Is this possible and if yes then how?

any help would be appreciated.
11 anni tempo fa
anyone??
11 anni tempo fa
kinjal.metizsoft wrote:
Hello,

I am new in NopCommerce and I am using NopCommerce 1.65. I have doubt related to shipping settings.

My requirement is user will put his zip code and the system will tell if the store deliver to that area or not. Zip codes will be added from admin page.

Is this possible and if yes then how?

any help would be appreciated.

I guess you are using 2.65; but what you want is not available out of the box. Maybe you can do it with Shipping Director
11 anni tempo fa
Yes, if you are using 2.x then you can do this with Shipping Director.   See this example blog.  The ErrorExit type can check a condition expression and then show the customer a message rather than shipping options.

If you don't have many zip codes to check, then you can code the expression like this  (the leading "!" is the NOT operator)

!"12345,23456,98765".Contains(ShippingAddress.ZipPostalCode)

If you have a very large number of zip codes, then you may want to store them in a separate table in the database, and use Shipping Director's ability to execute a SQL query (or stored procedure).  Here's an example blog.  In your case, you would just need one SQL query, and the SD records would look something like this (assuming a table called ValidShippingZip with a field ZipCode):


String  Zip  ShippingAddress.ZipPostalCode

Integer  ZipMatchCount  select Count(1) from ValidShippingZip where ZipCode = @p1; [Zip]

ErrorExit  Check ZipCode  ZipMatchCount = 0  "Sorry, we can't deliver to that zip code"
11 anni tempo fa
Yes, I am using NopCommerce 2.65 by mistake i wrote 1.65.

Thanks for give me solution. :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.