Support » Plugin: WooCommerce » How to hide/disable single product page

  • Resolved sylviazeng

    (@sylviazeng)


    Hi,
    I am trying to build a e-commerce web with wordpress + woocommerce. But I don’t need single product pages. I just want a shop page.
    I found the code on the internet and pasted it on the function.php file of my child theme.

    remove_action( ‘woocommerce_before_shop_loop_item’, ‘woocommerce_template_loop_product_link_open’, 10 );
    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_product_link_close’, 5 );

    And the whole theme looked like this now:

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘themify_shoppe_child_enqueue_styles’ );
    function themify_shoppe_child_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }
    ?>
    remove_action( ‘woocommerce_before_shop_loop_item’, ‘woocommerce_template_loop_product_link_open’, 10 );
    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_product_link_close’, 5 );

    But it didn’t work. I tried to paste the code both inside and outside of ?>. But didn’t work, too.

    Any advice or help? Thanks a lot!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to hide/disable single product page’ is closed to new replies.