Our Mailing Address (formerly Shipping Address) Add On allows you to capture the member’s mailing information at checkout. Take full control of the areas you ship to when using the Mailing Address Add On by allowing members to only have the ability to checkout of your membership site by using a valid zip code.

Banner image for Restrict your Membership Sites Shipping Locations by Specifying Valid Zip Codes

About the Code Recipe

It can be quite disheartening to receive a payment from a member who just purchased a membership from your site, only to realize that their mailing address falls outside of your mailing zones. Despite the notices and banners that you carefully placed around the site, warning potential members of the limited mailing areas – a purchase was made – it happens.

The code recipe below will allow you to set an array of valid zip codes that your site will accept in order to process the order. If the user enters a zip code that is not valid – in other words, you do not mail to that specific location –  a warning banner will appear apologizing that you do not mail to that area and an alternative location should be selected. If the member enters a valid zip code, no warning is shown and the order is processed normally. You will need to edit the array of zip codes to match the zip codes of areas that you mail to.


The Code Recipe

Note: In order for this Code Recipe to work you will need to have Paid Memberships Pro – Mailing Address installed and activated on your site.

Adding the Recipe to Your Website

You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.

Free Course: Membership Site Development—The Basics

Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.

Featured Image for Membership Site Development Course: The Basics
Was this article helpful?
YesNo