Support » Plugins » Woocommerce product category brand filter, how to get the name?

  • I have the Woocommerce product brand plugin, so my product category pages can be filtered by brand like this:

    example.com/pc/cars/trucks/?filtering=1&filter_product_brand=76

    Now my problem is that I would like to get the name of the brand that we are filtering by.

    I have tried various things in my code, but so far I haven’t been able to get the name of the brand.

    Closest match has been the code below, but it returns the first brand for product category pages where we don’t filter by brand.

     $terms = get_the_terms( $product_category->ID, 'product_brand' );
            foreach ($terms as $term) {
                $product_cat = $term->name;
                break;
            }

    Any ideas?

    Thanks.

  • The topic ‘Woocommerce product category brand filter, how to get the name?’ is closed to new replies.