[Resolved] woocommerce category images / rows

Home Forums Support [Resolved] woocommerce category images / rows

Home Forums Support woocommerce category images / rows

Viewing 15 posts - 31 through 45 (of 45 total)
  • Author
    Posts
  • #1090290
    Tom
    Lead Developer
    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
    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
    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
    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.

    #1128272
    sparkle

    i was kind of able to get the look i want with elementor, but it’s not nearly as nice as your standard woocommerce treatment.

    #1128343
    Tom
    Lead Developer
    Lead Developer

    That’s a shame. Were you able to find a way to separate the products and categories? If we can get them into their own containers, we have a lot more options.

    #1128353
    sparkle

    with elementor, yes. one section is the categories and one is the products. i had to do a little css to get the categories to display the way i wanted as they duplicated in the products box and i had to hide them …

    https://www.thebridgebrothers.com/product-category/apparel/

    #1129065
    Tom
    Lead Developer
    Lead Developer

    That looks good. I wonder if it’s possible to separate the categories/products if we overwrite their category template? Might be worth looking into if you’re not comfortable sticking with the Elementor approach.

    #1129086
    sparkle

    i just think yours is prettier out of the box. technically this works and i use elementor heavily on this site. i’ve not done much with woocommerce templating, at least not very successfully. but i’m willing to try if you have tips.

    #1129287
    Tom
    Lead Developer
    Lead Developer

    I looked at their templates and they don’t make it very easy, unfortunately. What you have is likely the best method for this kind of layout.

    #1129776
    sparkle

    i love that you looked. thank you. πŸ™‚

    #1130005
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

Viewing 15 posts - 31 through 45 (of 45 total)
  • You must be logged in to reply to this topic.