• Resolved geniushosting

    (@geniushosting)


    When a product is set as “hidden” in Catalog visibility: Hidden (in WP product page)Why does it still show up in Woo Product Grid?

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

Viewing 1 replies (of 1 total)
  • Plugin Contributor Adarsh Pawar

    (@axmusic)

    Hi @geniushosting

    Thank you for reaching out to us.

    We’ll be adding an option to Product Query for Catalog Visibility in our WooCommerce widgets soon.

    In the meantime, you can use the Query ID option with a custom filter to hide products with catalog visibility hidden. Here’s the snippet you can use:

    function UECatalogVisibility($args, $widgetData) {
    if (isset($args['tax_query'])) {
    $args['tax_query'][] = array(
    'taxonomy' => 'product_visibility',
    'field' => 'name',
    'terms' => array('exclude-from-catalog'),
    'operator' => 'NOT IN',
    );
    } else {
    $args['tax_query'] = array(
    array(
    'taxonomy' => 'product_visibility',
    'field' => 'name',
    'terms' => array('exclude-from-catalog'),
    'operator' => 'NOT IN',
    ),
    );
    }

    return $args;
    }

    add_filter("FilterUECatalogVisibility", "UECatalogVisibility", 10, 2);

    Add this code to your theme’s functions.php file or via a code snippet plugin. Then, in the Woo Product Grid widget, go to Content > Product Query > Query ID and enter: FilterUECatalogVisibility

    This will exclude products set as hidden in the catalog.

    If you need help setting this up, feel free to open a private support ticket on our official website.

    Thanks again!

Viewing 1 replies (of 1 total)

The topic ‘Catalog visibility: Hidden’ is closed to new replies.