[Support request] woocommerce category images / rows

Home Forums Support woocommerce category images / rows

This topic contains 36 replies, has 3 voices, and was last updated by  Tom 3 days, 15 hours ago.

Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
    Posts
  • #1090290

    Tom Lead Developer

    So now it’s using the option in Customize > Layout > WooCommerce.

    This function should now overwrite that Customizer option:

    add_filter( 'option_generate_woocommerce_settings', 'tu_custom_wc_columns' );
    function tu_custom_wc_columns( $options ) {
        if ( is_product_category( 'apparel' ) ) {
            $options['columns'] = 6;
        }
    
        return $options;
    }

    Can you confirm that it’s still added? The account you set up for me doesn’t have file editing capabilities so I’m not able to see the theme editor.

    Let me know 🙂

    #1090309

    sparkle

    i took everything out but that and it’s still not working and we’re back to 3 across.

    i added the wp-file-manager plugin and turned of the security plugin to give you better access.

    #1090796

    Tom Lead Developer

    Grr, wonder what’s happening. I’d like to debug but don’t want to crash the file editing system using var_dump. Can you try adding the filter using a plugin like Code Snippets possibly?

    #1091499

    sparkle

    hmm. i’ve never used that plugin, but i activated it and added the snippet. check me, because i’m not sure if i did it right. there’s nothing at all in my functions file now.

    we’re back to four across now tho. lol.

    i have no idea what a var_dump is but it’s ok to knock the dev site down. i’m not working in it for the next couple days. i don’t think if you take it down, it would affect my live site — but i’m not actually saavy about that. i’m happy to give you whatever access you need.

    thanks tom. sorry this is frustrating, tho it is heartening to me when i can’t figure something out and then it’s also a puzzle for the support folks.

    #1092029

    Tom Lead Developer

    I’m not sure why that filter wasn’t working – super strange.

    Instead, I tried this:

    add_filter( 'generate_woocommerce_container_classes', function( $classes ) {
    	if ( is_product_category( 'apparel') ) {
    		$classes = array_diff( $classes, [ 'wc-columns-4' ] );
    		$classes[] = 'wc-columns-6';
    	}
    	
    	return $classes;
    } );

    It seems to be working 🙂

    #1095960

    sparkle

    oh. we are SO close.

    the goal was to make the subcategories 6 across, but products 3 across. right now they are 6.

    View post on imgur.com

    #1096588

    Tom Lead Developer

    I’m not seeing a way to do that, unfortunately. All of the categories and products are within the same container, so we can’t target them differently.

    If you can somehow separate the two, we should be able to.

Viewing 7 posts - 31 through 37 (of 37 total)

You must be logged in to reply to this topic.