How to Remove Catalog Ordering in WooCommerce: A Beginner’s Guide
Want to turn your WooCommerce store into a simple product catalog? Maybe you’re offering services where direct purchase isn’t the right approach, or perhaps you want to generate leads instead of immediate sales. Whatever your reason, removing the “Add to Cart” functionality and other ordering elements can transform your WooCommerce site into a clean, browsable catalog. This article will guide you through several methods, explaining the pros and cons of each so you can choose the best option for your needs.
Why Remove Ordering from WooCommerce?
Think of a local artisan bakery. They might showcase their cake designs and flavor options online (a catalog), but require customers to call or email for custom orders and pricing. They aren’t selling online, but using their website as a visual menu. That’s a perfect use case for a WooCommerce catalog.
Here are a few more reasons why you might want to remove the ability to directly order from your WooCommerce site:
- Services instead of Products: You offer consulting, coaching, or other services where pricing and customization are highly variable.
- Lead Generation: You want potential customers to contact you for quotes or demonstrations.
- Complex Products: Your products require extensive customization or pre-order consultations. Think custom-built furniture or specialized industrial equipment.
- Memberships or Subscriptions: You use a separate system for managing memberships or recurring subscriptions and simply want to showcase available options.
- Wholesale Only: You only sell to businesses and require them to register and be approved before they can see pricing or place orders.
- Easy to Install and Use: No coding required. Activate the plugin, configure a few settings, and you’re done.
- Often Feature-Rich: Many catalog mode plugins offer options to hide pricing, remove “Add to Cart” buttons, and display custom contact forms.
- Reversible: Easily switch back to a fully functional store by deactivating the plugin.
- Plugin Dependency: You rely on a third-party plugin for functionality.
- Potential Compatibility Issues: Occasionally, plugins can conflict with other themes or plugins on your site.
- Full Control: You can customize the behavior precisely to your needs.
- No Plugin Dependency: Reduces the number of plugins on your site.
- Potentially More Efficient: Can be more lightweight than a full-featured plugin.
- Requires Coding Knowledge: Errors in your code can break your website.
- Theme Updates: Code modifications might need to be adjusted after theme updates.
- More Complex: Requires understanding of WooCommerce templates and filters.
Method 1: Using a WooCommerce Catalog Mode Plugin (Easiest)
This is often the simplest and most recommended method, especially for beginners. Several plugins are designed specifically to switch your WooCommerce store to catalog mode.
Pros:
Cons:
Example: YITH WooCommerce Catalog Mode
YITH WooCommerce Catalog Mode is a popular choice. Here’s how to use it:
1. Install and Activate: From your WordPress dashboard, go to Plugins > Add New. Search for “YITH WooCommerce Catalog Mode” and install/activate it.
2. Configure Settings: Go to YITH > Catalog Mode.
3. Enable Catalog Mode: Set “Enable YITH WooCommerce Catalog Mode” to “Yes”.
4. Customize: Configure other settings like hiding the “Add to Cart” button, hiding prices, and adding a custom enquiry form URL.
Why it works: This plugin effectively disables the core purchasing functionalities of WooCommerce by selectively hiding elements related to ordering. It provides a user-friendly interface for controlling these changes.
Method 2: Using Custom Code (More Advanced)
If you’re comfortable with PHP and WordPress theme editing, you can use custom code to remove the catalog ordering elements. This is a more flexible approach but requires technical knowledge.
Pros:
Cons:
Example Code Snippets:
1. Remove “Add to Cart” Button (Globally):
Add this code to your `functions.php` file of your child theme (strongly recommended!) or use a code snippets plugin:
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 );
Why it works: These `remove_action` calls unhook the functions responsible for displaying the “Add to Cart” button from the WooCommerce templates. `woocommerce_after_shop_loop_item` handles the button on the shop/archive pages, and `woocommerce_single_product_summary` handles it on the individual product pages.
2. Remove Prices (Globally):
add_filter( 'woocommerce_get_price_html', '__return_empty_string' ); add_filter( 'woocommerce_cart_item_price', '__return_empty_string' ); add_filter( 'woocommerce_cart_subtotal', '__return_empty_string' ); add_filter( 'woocommerce_cart_total', '__return_empty_string' );
Why it works: These `add_filter` calls use the `woocommerce_get_price_html` filter to replace the price output with an empty string, effectively hiding the price on product pages and in the cart.
3. Remove Cart Page:
Redirect users who try to access the cart page:
add_action( 'template_redirect', 'remove_wc_cart_page' ); function remove_wc_cart_page() { if ( is_cart() ) { wp_safe_redirect( home_url() ); exit; } }
Why it works: This code checks if the user is trying to access the cart page (`is_cart()`). If they are, it redirects them back to the home page (`home_url()`). `exit;` prevents further code execution after the redirect.
Important: ALWAYS use a child theme when modifying your theme’s `functions.php` file. This protects your changes during theme updates.
Warning: If you are not comfortable editing PHP code, it is highly recommended that you use a plugin. Incorrectly editing your `functions.php` file can cause errors on your website.
Method 3: CSS (Limited Solution)
While not as robust as the other methods, CSS can be used to hide certain elements like the “Add to Cart” button.
Pros:
- Simple and Quick: Easily added to your theme’s custom CSS area or via a plugin like Simple Custom CSS.
- No PHP Required: Ideal for users with limited technical skills.
Cons:
- Doesn’t Prevent Actual Purchases: Hides the button, but users could still potentially access the cart directly (if they know the URL).
- Not as Reliable: Can be easily overridden by theme updates or other CSS rules.
- Only Hides, Doesn’t Disable: The button is still technically there, just invisible. This could affect page performance.
Example CSS:
.woocommerce div.product form.cart .button,
.woocommerce-page div.product form.cart .button {
display: none !important;
}
.woocommerce .price {
display: none !important;
}
Why it works: This CSS code targets the “Add to Cart” button and price elements within WooCommerce product forms and sets their `display` property to `none`, effectively hiding them from view. The `!important` declaration ensures that these rules override any conflicting CSS rules.
Choosing the Right Method
- Beginner: Use a WooCommerce catalog mode plugin.
- Intermediate: Consider using custom code snippets in your child theme if you have some PHP knowledge and want more control.
- Advanced: A combination of custom code and CSS might be appropriate for highly customized solutions.
- Quick Fix: If you just need to hide the “Add to Cart” button visually, and you aren’t concerned about accessibility or potential workarounds, CSS is a quick solution.
In conclusion: Removing catalog ordering functionality from WooCommerce can be accomplished using various methods, each with its advantages and disadvantages. Choose the method that best suits your technical skill level and the specific requirements of your website. Remember to test thoroughly after implementing any changes! Good luck!