Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1281820
    sosmond
    Participant

    Is there a way to hide products from a specific category from showing on the main shop cart page http://jeff-dillon.com/portfolio/ for example products in the category “people”

    If someone selected the “people” category then they would see the products in the people category.

    #1281863
    Rupok
    Member

    Hi there,

    You can do it with some CSS but it might cause unusual issue with the layout. Let’s try adding this under Custom > CSS in the Customizer.

    .woocommerce ul.products > li.product_cat-people {
      display: none;
    }

    Hope this helps.

    #1292224
    sosmond
    Participant

    Thank you for this solution, it does do what is should but like you said it does leave a blank placeholder in the list where the item is not displayed.

    Do you have any other ideas/methods of filtering out a category from the display?

    #1292371
    Paul R
    Moderator

    Hi,

    You can try this code instead.

    
    .post-type-archive-product.woocommerce li.product.first {
        clear: none;
    }
    
    .post-type-archive-product.woocommerce li.product {
        vertical-align: top;
        display: inline-block;
        float: none;
    }
    .post-type-archive-product.woocommerce li.product.last {
        margin-right: 2%;
        margin-left:2%;
    }
    
    .post-type-archive-product.woocommerce .cols-3 li.product {
        width: 28.3%;
    }
    
    .post-type-archive-product.woocommerce ul.products > li.product_cat-people {
      display: none;
    }
    

    Hope that helps.

    #1292913
    sosmond
    Participant

    worked perfect, thank you!

    #1292969
    Prasant Rai
    Moderator

    You are most welcome. 🙂

  • <script> jQuery(function($){ $("#no-reply-1281820 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>