- This topic has 44 replies, 3 voices, and was last updated 4 years, 3 months ago by Tom.
-
AuthorPosts
-
December 2, 2019 at 11:20 am #1090290TomLead DeveloperLead 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 π
December 2, 2019 at 11:29 am #1090309sparklei 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.
December 2, 2019 at 6:22 pm #1090796TomLead DeveloperLead DeveloperGrr, 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?December 3, 2019 at 5:37 am #1091499sparklehmm. 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.
December 3, 2019 at 9:48 am #1092029TomLead DeveloperLead DeveloperI’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 π
December 6, 2019 at 7:21 am #1095960sparkleoh. we are SO close.
the goal was to make the subcategories 6 across, but products 3 across. right now they are 6.
December 6, 2019 at 8:01 pm #1096588TomLead DeveloperLead DeveloperI’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.
January 10, 2020 at 1:43 pm #1128272sparklei was kind of able to get the look i want with elementor, but it’s not nearly as nice as your standard woocommerce treatment.
January 10, 2020 at 4:12 pm #1128343TomLead DeveloperLead DeveloperThat’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.
January 10, 2020 at 4:42 pm #1128353sparklewith 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 …
January 11, 2020 at 9:46 am #1129065TomLead DeveloperLead DeveloperThat 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.
January 11, 2020 at 10:33 am #1129086sparklei 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.
January 11, 2020 at 5:13 pm #1129287TomLead DeveloperLead DeveloperI 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.
January 12, 2020 at 7:51 am #1129776sparklei love that you looked. thank you. π
January 12, 2020 at 4:09 pm #1130005TomLead DeveloperLead DeveloperNo problem! π
-
AuthorPosts
- You must be logged in to reply to this topic.