• Resolved alpha31

    (@alpha31)


    Hello,

    On this website we are using the default Woo brands with a shortcode:

    [product_brand_thumbnails columns=”6″ orderby = “menu_order” show_empty=”false” number=”12″]

    However on versions later than 9.9.3 the show_empty=”false” breaks the shortcode and leads to no results.

    We tested with 2025/Storefront and other themes and only Woo installed, still the same. On version 9.9.3 of Woo it works on all themes and with everything installed.

    We tested all versions 10 rc-1, 9.9.5 and 9.9.4 and a couple of older ones before 9.9.3.

    On 9.9.3 and older it works, on anything newer it’s broken.

    Best regards,

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thank you for bringing this to our attention.

    I’ve tested the [product_brand_thumbnails] shortcode on my test site, and I can confirm the issue:

    • With WooCommerce 9.9.5 and above, the shortcode only displays one brand thumbnail instead of all expected brands.
    • When downgrading to WooCommerce 9.9.3, all brand thumbnails appear correctly as intended.

    This confirms the issue is introduced in versions after 9.9.3 and appears to be a regression related to the show_empty="false" parameter.

    I’ll go ahead and report this to our development team so it can be investigated further. I’ll follow up as soon as I have any updates to share.

    Also, I would suggest you submit a thread on here too https://github.com/woocommerce/woocommerce/issues so our developer will look into this and help you accordingly.

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hi @alpha31

    This looks like a regression in WooCommerce after 9.9.3 affecting how show_empty="false" works with brand thumbnails. It might be related to term counts not updating properly behind the scenes.

    As a workaround, try adding this snippet to your site to force WooCommerce to recount brand terms: https://gist.github.com/shameemreza/2ebcfdb628f83e01d012e288aee0e46e

    /**
    * Force a recount of all brand terms
    */
    function recount_brand_terms() {
    // Only run on the homepage
    if ( !is_front_page() && !is_home() ) {
    return;
    }

    // Check if the product_brand taxonomy exists
    if ( !taxonomy_exists( 'product_brand' ) ) {
    return;
    }

    // Get all brand terms
    $brands = get_terms( array(
    'taxonomy' => 'product_brand',
    'hide_empty' => false,
    'fields' => 'id=>parent',
    ) );

    // Recount terms
    if ( !empty( $brands ) && !is_wp_error( $brands ) ) {
    _wc_term_recount( $brands, get_taxonomy( 'product_brand' ), true, false );
    }
    }

    This triggers _wc_term_recount() and updates the counts WooCommerce uses to decide which brands are empty. If the shortcode works after adding it, you’ll know that was the root issue, and you can remove the snippet once things display correctly.

    Let me know if this helps, and we’ll keep watching for updates on the core fix.

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hi @alpha31

    Just a heads-up, that snippet I shared earlier wasn’t quite right. The issue isn’t about outdated meta values or needing to force a recount. What is actually going on is that after WooCommerce 9.9.3, the product_brand_thumbnails shortcode double-filters the terms when show_empty="false" is set. Both get_terms() and remove_terms_with_empty_products() try to exclude empty brands, and together they end up excluding everything.

    Here is the updated snippet that fixes it by preventing that second round of filtering when it’s not needed. It restores the shortcode’s behavior from 9.9.3 and earlier.

    If the GIF is not showing up, here is a direct link: https://d.pr/i/MhoT0d

    I hope this helps! Please let us know how it goes or if you need further assistance.

    Thread Starter alpha31

    (@alpha31)

    Hello,

    Yes, we tested recount previously, but we should have mentioned that, a miss on our end.

    We tested the fix snippet and it is working on a dev install.

    We will wait for fix in a plugin update. Until then we will cap the version update to 9.9.3 as implementing the snippet is not viable at the moment as we would later have to remove it on every website we have updated during that time.

    We hope this will be included in the changelog when a fix is implemented, so we can continue updates of the plugin.

    Best regards,

    Hi @alpha31,

    Thank you for the update—I really appreciate you taking the time to look into this. Have you had a chance to report the issue on GitHub yet? If so, could you kindly share the link to the report? That way, others experiencing the same issue can follow along, and the developers can respond directly there.

    Thread Starter alpha31

    (@alpha31)

    Hello,

    Yes, we just submitted a Bug here: Git Bug report

    Best regards,

    Alpha Best

    Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @alpha31,

    Thanks for confirming and for taking the extra step to submit a GitHub bug report, that’s definitely the right move! Keeping an eye on the issue page is a great way to stay updated as the development team reviews and works on a fix.

    If anything changes or you need help adapting once a patch is released, feel free to check back in. We’re here to help make the transition smooth when it’s time to upgrade again.

    Plugin Support Feten L. a11n

    (@fetenlakhal)

    Hi there,

    As we haven’t had any updates, I’ll assume this is resolved and close the thread. Feel free to reconnect anytime.

    Apart from this, if you’re happy with our plugin and the support you’ve received, we’d really appreciate a review: https://wordpress.org/support/plugin/woocommerce/reviews/#new-post

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Woo Brands’ is closed to new replies.