Support » Plugin: Category Slider for WooCommerce » hide category if subcategory if empty

  • Resolved tajmohamed30

    (@tajmohamed30)


    hi

    I have subcategory(store name) from main category(breakfast) in my homepage like below examples

    Ex 1) Breakfast>store name>product 1, product 2
    Ex 2) Lunch>store name>product 3, product 4
    Ex 3) Fried Rice>store name>product 5, product6

    fyi – my website is a multivendor store, in homepage when user clicks breakfast they can see list of all store names who sell breakfast, next when clicked store name, its corresponding products of store will be shown

    I have enabled product timer plugin to hide breakfast products at lunch and dinner time so after 10am breakfast products is set to hidden

    now the issue is when I have enabled hide empty category option in our category plugin the category(breakfast) still getting displayed with stores names inside it(without any products)

    so here the product timer is setting all products to hide but not hiding the store name, so breakfast is considered with count of store names and it is not considered as empty and is getting displayed

    I have tried below snippet but doesn’t helped

    function woo_hide_product_categories_widget( $list_args ){
     
                $list_args[ 'hide_empty' ] = 1;
     
                return $list_args;
     
    }
     
    add_filter( 'woocommerce_product_categories_widget_args', 'woo_hide_product_categories_widget' );

    could you please help how to hide subcategory(store names) and category(breakfast) if product count is empty

    regards

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.