Hide certain product category under product loop

This topic has 4 replies, 2 voices, and was last updated 6 years, 4 months ago ago by Olga Barlow

  • Avatar: r1nk
    r1nk
    Participant
    August 8, 2018 at 04:35

    Hello, in content-product.php , I’ve seen this code echo all product categories for each product.

    <?php if (etheme_get_option('product_page_cats')): ?>
                
                    <div class="products-page-cats">
                        <?php 
                            $size = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
                            echo $product->get_categories( ', ' ) . get_post_meta( $post->ID, '_year', true ); 
    						
                        ?>
                        
                    </div>
    	        <?php endif ?>

    What if I’ve created let’s say two new product category call “Test” and “Test2”, but I don’t want to display both of those new category for product loop. What should I add inside the code?

    3 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 8, 2018 at 09:51

    Hello,

    This functionality is the default WooCommerce functionality and is not related to our theme. You can check and try this solution https://stackoverflow.com/questions/48848387/hide-product-category-from-category-list-on-shop-page-in-woocommerce

    Regards

    Avatar: r1nk
    r1nk
    Participant
    August 8, 2018 at 12:09

    Yeah, thought you guys can help with woocommerce too.

    The link you gave me work for whole assign page. I’m more looking into direct edit the content-product.php only so that it only affects the product loop.

    Anyway, thanks for the reply.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 8, 2018 at 13:38

    Hello,

    Contact WooCommerce support about this, it’s related to WC plugin functionality.

    Regards

  • Tagged: 

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

Helpful Topics

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.