Are you looking for a way to build a catalog of products? I want to show you how to Use WooCommerce as Catalog Only. WooCommerce is popular among online store owners because it is very flexible.
It includes inbuilt features such as a single product gallery and carousel, image zoom, product description tabs, attributes, categories, tags, and related products.
As you will quickly find out, this is not a complicated process to build a catalog of products without add to cart, price, and the product gallery. You might want to restrict these functions to logged in, registered users only.
This is a much better version than a standard image gallery. It is a great way to display your products until the time you can sell the products in your store.
For example, if you run a wholesale business and wish to hide your prices from the public, this is the best solution for you.
However, how can you disable the WooCommerce Add to Cart button, cart, and checkout functionality?
Use WooCommerce as Catalog Only
In this brief tutorial, we will show you how to restrict the cart and checkout functions to logged in, registered users only.
We will use a custom PHP code snippet that allows you to do this. Read on, as we will also share a plugin you can use if you need additional functionality.
Let us see how you can achieve this.
Steps to Hide Price & Add to Cart for Logged Out Users
Here are the steps you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will hide the price and add to cart for logged out users.
- Add the following code to the php file:
* @snippet Hide Price & Add to Cart for Logged Out Users
*/
add_action( ‘init’, ‘njengah_hide_price_add_cart_not_logged_in’ );
function njengah_hide_price_add_cart_not_logged_in() {
if ( ! is_user_logged_in() ) {
remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 );
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );
remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );
}
}
[/php]
The “is_user_logged_in” PHP function is very helpful and in our example, some code is executed when the user is not logged in.
If you do not have some coding knowledge, we recommend using the YITH WooCommerce Catalog Mode plugin.
The free version allows you to hide the Add to Cart everywhere on the site and disable the Cart and Checkout pages.
However, it is important to note that the premium version includes more features like:
- It includes an “exclusion list” that allows you to apply the catalog mode to a specific list only
- It includes an option to hide prices (as well as Add to Cart buttons) to all users or non logged in users
- It includes an option to enter a message instead of the price e.g. “POA” or “Register to see prices”
- It includes an “inquiry form“, compatible with Contact Form 7 or Gravity Forms that allows users to request information, quotes, or prices via a direct form on the product page
Conclusion
By now, you should be able to use WooCommerce as a catalog only. We recommend using the code snippet, as plugins may bloat your site and this makes it very slow.
If you are not able to customize it for your specific objectives, we recommend using a reliable plugin.
Similar Articles
- How to Edit Billing Details WooCommerce Checkout Page
- How to Set Up Homepage in WooCommerce Storefront
- How to Install WooCommerce Storefront Step By Step [Complete Guide]
- How to Add Custom Add to Cart Button In WooCommerce
- How to Change Checkout Endpoints WooCommerce
- How to Hide Product Image on Cart Page WooCommerce
- How to Remove Cart Page WooCommerce Storefront Theme
- How to Change Apply Coupon Button Text In WooCommerce
- How to Add Product to Cart Programmatically in WooCommerce
- How to Change Add to Cart Button to Read More WooCommerce
- How to Create WooCommerce After Login Redirect to Homepage
- How to Create WooCommerce Clear Cart Button Shortcode
- How to Create WooCommerce Redirect After Checkout Per Product
- How to Customize WooCommerce Currency [Code Snippets]
- How to Hide Product Prices Based on User Role Storefront
- How to Disable Shipping By Category In WooCommerce
- How to Change Shipping Label WooCommerce
- How to Check if User is Logged In WordPress
- How to Change Size of Cart Icon In WooCommerce Storefront Theme
- How to Redirect User If Not Logged in WordPress » Page Redirect