Show products based on customer's postal code

Show products based on customer's postal code

VNMarket
Visitor
1 0 1

Hi-

 

Since I can't find any discussions on this subject, I hope someone could share a solution.

 

I would like to do something like:

1. a user enters their postal code when visiting my store (they can also change their postal code if they want)

2. products are displayed based on their postal code

 

Some geo apps can show products based on current user location which may not be their shipping address. Also, they are at countries/cities levels. Hope I'm wrong.

 

Thanks,

Anh Tuan

Replies 2 (2)

Iris
Shopify Staff
824 67 104

Hi @VNMarket ,

 

Thanks for reaching out. That’s an interesting question. 

 

Can you tell me more about why do you need this feature so I can provide the best advice possible?

 

In the meantime, I’d like to share an app option that might work for you. The Product Zipcode Validator app allows customers to check the product’s availability for shipment via Zipcode search on Home Page or Product Page.

 

The great thing about it is that it offers a 7-day free trial so you can test if it’s the right fit for your business. You can install the app to your store from this link here

 

Let me know what you think!

Iris | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

nick_nebullam
Shopify Partner
3 0 0

Howdy VNMarket! 

I have the same problem as you, and essentially want a feature called "Customer address based product catalogs". I've got a slight workaround utilizing a few plugins and some custom liquid code, but please reach out if you discover a better way of doing this! 

 

Plugins:

1. CustomerFields - for adding shipping/delivery address on account creation
2. LockSmith - for locking product pages until customer logs in.

 

Explanation:
A user who visits the site and is unauthorized will be prompted to either login or signup (Accomplished with LockSmith). On signup, the user is prompted to enter their shipping address so that they can see the correct products based on their location (Accomplished with CustomerFields). I then utilize liquid control flow tags to properly display the products, or a message letting them know that no products are available for their postal code. Feel free to reach out if you have questions about this approach. 

 

Liquid Snippet:

{% if '50010' contains customer.default_address.zip %}

   {% comment %} loop through product collection {% endcomment %}

   {% for product in collections['mycollection'].products %}

       <li>product.title</li>

   {% endfor %}

{% else %}

<h1>Sorry! no products available</h1>

{% endif %}