• Resolved psychic9

    (@psychic9)


    Hi
    is there any snippet to exclude wishlist for certains products or categories?
    Best
    S

Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    You can achieve your requirement by adding the below code in your child theme’s functions.php.

    add_filter('thwwc_show_wishlist_button', 'th_hide_for_specific_cat', 10, 2);
    function th_hide_for_specific_cat($show, $product){
        $terms = get_the_terms( $product->ID, 'product_cat' );
        $cat_present = false;
        if($terms){
            foreach ($terms as $term) {
                $product_cat_name = $term->name;
                if($product_cat_name == 'Category Name 1' || $product_cat_name == 'Category Name 2'){
                    $show = false;
                }
            }
        }
        return $show;
    }

    Hope this helps.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘How to exclude for specific categories’ is closed to new replies.