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.

Table of contents
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.

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.

Code Recipe
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.