Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1022860

    Hi,
    i use enfold 4.5 and Woocommerce 3.4.6 and want to change the look of my startpage. For that I want to use the product grid and product slider. But I can select any taxonomy … the grid and the slider always show all products.
    Please help. Thank you!

    #1023505

    Hey Martin,

    Credentials did not work for me. Could you please update the credentials?

    Best regards,
    Victoria

    #1023623
    This reply has been marked as private.
    #1024552

    Hi Martin,

    A brochure is also a product and so it is shown in the product grid.

    Best regards,
    Victoria

    #1024745

    No, you missunderstood me. There are is a product category with the title “Produkte” and e product category with the title “Broschüren”. In the product slider I just want to show the products of the categroy “Produkte”. But it shows always all products, even if I choose the category “Produkte” in the configuration of the product slider.

    Best regards,
    Martin

    #1025059

    Hi Martin,

    The thing is that there should not be a category called products, there can be a slug conflict and it might not behave as expected.

    Best regards,
    Victoria

    #1025136

    Hi Victoria,
    changed the name of the category … sorry, same result! The Slider still shows the products of all categories.

    Best regards,
    Martin

    • This reply was modified 6 years ago by MetrixMF.
    #1025611

    Hi Martin,

    Best regards,
    Victoria

    #1025627

    Hi Victoria,

    deleted these files (dont need it really … just wanted to try out something), but nothing changed.

    Best regards,
    Martin

    #1026029

    Hi Martin,

    Can you please disable all plugins besides WooCommerce?

    Best regards,
    Victoria

    #1026373

    Hi,

    I duplicated the installation and disabled all plugins beside woocommerce. Same result.

    Best regards,
    Martin

    #1027806

    Hi,

    The following code in the functions.php file alters the product slider query.

    add_action( 'pre_get_posts', 'hidden_search_query_fix' );
    function hidden_search_query_fix( $query = false ) {
    	if ( ! is_admin() && isset( $query->query['post_type'] ) && $query->query['post_type'] === 'product' ) {
    		$tax_query = $query->get( 'tax_query' );
    		$tax_query = array();
    		$tax_query[] = [
    			'relation' => 'OR',
    			[
    				'taxonomy' => 'product_visibility',
    				'field'    => 'name',
    				'terms'    => 'exclude-from-catalog',
    				'operator' => 'NOT IN',
    			],
    			[
    				'taxonomy' => 'product_visibility',
    				'field'    => 'name',
    				'terms'    => 'exclude-from-catalog',
    				'operator' => '!=',
    			],
    		];
    		$query->set( 'tax_query', $tax_query );
    	}
    }

    The product slider works properly when it’s disabled.

    Best regards,
    Ismael

    #1030001

    Ups! Thank you! Sometimes you don’t see that “simple” things.
    Best regards,
    Martin

    #1030099

    Hi,

    I’m glad you were able to get this solved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘product grid and product slider ignore taxonomy selection’ is closed to new replies.