• Paul

    (@paulschiretz)


    Hi there,

    I sell some seasonal items as bundles like a “christmas box” or “easter box”, if it’s off season i simply set the bundle to hidden(not visible in product catalogue or search) via the woocommerce product settings.

    But i noticed they still show up in the “also available as bundle” section on the product pages of the individual products.

    Can you add a check to the “also available as bundle” section to only show products which are visible in the product catalogue?

    Thanks!

    All the best,
    Paul

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @paulschiretz,

    In case you would like to hide this list of bundles in single product pages, choose “No, hide it” in Position settings of general settings of the plugin, then update option.
    2022-04-26_11-33-05.png
    You can read this article to know how to configure position of Bundles on single product and shop archive page

    Regards,

    Thread Starter Paul

    (@paulschiretz)

    Hi @miemie,

    Yes i know how to do that, but i don’t want to hide the whole section, i just would like do filter out the hidden products!?

    Is there maybe a filter hook or similar to do that?

    All the best,
    Paul

    Thread Starter Paul

    (@paulschiretz)

    Hi again,

    Speaking code a simple tax query in your woosb_get_bundles function would do the trick, something like:

    			$query_args = array(
    				'post_type'      => 'product',
    				'post_status'    => 'publish',
    				'posts_per_page' => $per_page,
    				'offset'         => $offset,
    				'tax_query'      => array(
                                            'relation' => 'AND',
                                             array(
    					    'taxonomy'  => 'product_visibility',
    					    'terms'     => array( 'exclude-from-catalog' ),
    					    'field'     => 'name',
    					    'operator'  => 'NOT IN',
    				        ),
    					array(
    						'taxonomy' => 'product_type',
    						'field'    => 'slug',
    						'terms'    => array( 'woosb' ),
    						'operator' => 'IN',
    					)
    				),
    				'meta_query'     => array(
    					'relation' => 'OR',
    					array(
    						'key'     => 'woosb_ids',
    						'value'   => $id_str,
    						'compare' => 'LIKE',
    					),
    					array(
    						'key'     => 'woosb_ids',
    						'value'   => $sku_str,
    						'compare' => 'LIKE',
    					)
    				)
    			);

    instead of this

    			$query_args = array(
    				'post_type'      => 'product',
    				'post_status'    => 'publish',
    				'posts_per_page' => $per_page,
    				'offset'         => $offset,
    				'tax_query'      => array(
    					array(
    						'taxonomy' => 'product_type',
    						'field'    => 'slug',
    						'terms'    => array( 'woosb' ),
    						'operator' => 'IN',
    					)
    				),
    				'meta_query'     => array(
    					'relation' => 'OR',
    					array(
    						'key'     => 'woosb_ids',
    						'value'   => $id_str,
    						'compare' => 'LIKE',
    					),
    					array(
    						'key'     => 'woosb_ids',
    						'value'   => $sku_str,
    						'compare' => 'LIKE',
    					)
    				)
    			);

    Let me know what you think!

    All the best,
    Paul

    Thread Starter Paul

    (@paulschiretz)

    Can we have a filter for that?

    I think this would also solve this request: https://www.ads-software.com/support/topic/private-bundled-item-is-visible-to-public/

    All the best,
    Paul

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide products from “also available as bundle”’ is closed to new replies.