Many time there comes a situation where user needs a online catalogue of their products, but not actually want to sell them online.
Well the famous eCommerce plugin “WooCommerce” can be customized to fulfill the requirement.

Instead of going with custom post-type or any other solution, I would prefer to go with proven solution of WooCommerce. WooCommerce comes with capability to make simple, variation and grouped product. WooCommerce comes with functionality of have regular-price, sale-price, TAX, etc.
In short it has everything to list products online in the most elegant way possible. We just need to remove the add to cart functionality of WooCommerce to covert online shop to online catalogue.

After explaining the scenario,  now it’s turn to put the hands to code.

add_action( 'init', 'convert_shop_to_catalogue', 10 );
function convert_shop_to_catalogue() {
   /* remove add to cart from product single page */
   remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );

  /* remove add to cart from shop page */
  remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
}
Normal WooCommerce Shop Page
Normal WooCommerce Shop Page
Shop Page Without Add To Cart Button
Shop Page Without Add To Cart Button
Normal WooCommerce Product Single Page
Normal WooCommerce Product Single Page
WooCommerce Product Single Page Without Add To Cart Button
WooCommerce Product Single Page Without Add To Cart Button

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.