If you run a membership site and want only paying members to see prices and buy products, you need a way to hide prices and disable purchases for everyone else. This is useful for sites offering wholesale pricing, private collections, or exclusive products.

This recipe turns your WooCommerce store into a product catalog. Non-members can browse your products but cannot see prices or purchase items.

Featured image for code recipe on turning your Woo store into a catalog for non-members

Understanding the Code Recipe

This code recipe uses the pmpro_HasMembershipLevel() function to check if visitors to your store are logged-in members. If they are not members, it hides all product prices and removes the option to add products to the cart. Non-members still see product images, descriptions, and other details, but prices and checkout options disappear. The site effectively becomes a catalog for browsing only, prompting non-members to join before they can make purchases.

This approach allows you to show off products without publicly revealing prices or enabling buying options to everyone.

Screenshot showing before and after of non-members from viewing product prices and purchasing

About the Code Recipe

This recipe makes your WooCommerce store accessible for browsing, but restricts purchasing and price visibility to members only. It requires the PMPro WooCommerce Add On to be active, but it will not work if you’re using the Add On to sell membership levels directly as WooCommerce products. Use this snippet if you want a clear separation between your membership functionality and your online store.

Screenshot showing product listings before and after code recipe is applied

Code Recipe

Note: This recipe requires the PMPro WooCommerce Integration Add On but does not support selling membership levels as WooCommerce products.

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