This topic has 11 replies, 2 voices, and was last updated 3 years, 1 months ago ago by Olga Barlow
Hi. Love the theme!
I have my Shop Page Layout set to toggle the Sidebar Widgets with the content Collapsed Always. Works perfectly for the ‘post-type-archive-product’ page and the ‘tax-product_cat’ page.
When you view the ‘tax-product_tag’ Product Tag page, the sidebar shows the same Shop sidebar content/widgets, however, there is no toggle feature. The widgets are displayed in full with no +/- icon.
My question is: for the Product Tag page, is there a setting to also have the sidebar widgets toggled and collapsed like the rest of the shop pages?
Thanks.
I searched your code and found the theme-functions.php file with the etheme_add_body_classes function. If I add the following to my child functions.php, will this replicate the toggle functionality for Product Tag as well as Product Attribute taxonomy pages – and not give me problems that you can think of?
add_filter('body_class', 'sxf_add_body_classes_product_tag');
function sxf_add_body_classes_product_tag($classes){
if(is_product_tag() || is_product_taxonomy()){
$classes[] = (etheme_get_option('sidebar_widgets_scroll')) ? 's_widgets-with-scroll' : ''; // sidebar widgets with scroll
$classes[] = (etheme_get_option('sidebar_widgets_open_close')) ? 's_widgets-open-close' : '';
$sidebar_widgets_open_close_type = etheme_get_option('sidebar_widgets_open_close_type');
$classes[] = ($sidebar_widgets_open_close_type == 'closed' || (($sidebar_widgets_open_close_type == 'closed_mobile') && get_query_var('is_mobile')) ) ? 'swc-default' : '';
if ( etheme_get_option( 'ajax_product_filter' ) ) {
$classes[] = 'et-ajax-product-filter';
}
if ( etheme_get_option( 'ajax_product_pagination' ) ) {
$classes[] = 'et-ajax-product-pagination';
}
}
return $classes;
}
Hello,
You can use it. We’ll add the toggle for the mentioned taxonomy in the next theme update.
Regards
Hi Olga. That’s great thanks. Just wondering if the ajax filtering will be included for those taxonomies too? At present, each filter interaction requires a page refresh.
Is it possible I can enqueue the js for ajax filtering on taxonomies in the interim via child theme functions.php?
Edit: Until I hear back from you, I altered (cringe) the /xstore/framework/theme-init.php etheme_enqueue_scripts function, Line 151 to also check for Woocommerce Product Tag and Product Taxonomy / Attribute
if ( is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy()) {
That seems to make the ajax filter work without needing a page load. But I’d prefer to do it via the Child functions until the update is properly released. Thanks.
Hello,
Does everything work fine while you adding the mentioned code to the parent theme? If yes then we could just add it to our next update you then there is no need to edit child theme for you.
Regards
Hi again Olga 🙂
Yes those 2 conditions seem to work in the child function. I basically copied and pasted your parent function and changed the condition to only write those CSS classes for the Product Category and Product Tags, since your parent function was taking care of is_shop pages.
I imagine the parent function if statement will work for all 3 conditions:
if ( is_shop() || is_product_category() || is_product_tag() ) { ...
I’ll look for your change in the next update, then remove my child theme function.
Hello,
Ok, sure. Thank you for your understanding, a pleasure to work with!
Regards
Hi. I’ve recently updated to XStore 6.3.7 and I noticed that the toggling is now working on the Product Tag pages. However, adding the ajax filtering didn’t seem to be included for Product Tag pages in the update (refer comment 239817). I have created a Feature Request to enqueue ajax filtering on Product Tag pages too. Should I mark this as closed now, since I have made that feature request?
Hello,
Try to update theme to version 6.3.8 and XStore Core plugin to version 2.3.8. Check the filter after that.
Regards
Just checking to see when Ajax filtering will be rolled out to taxonomies – per my suggestion in this thread?
Hello,
You are able to use Ajax filtering on the product tag page. But if you plan to update the theme from the 6.3.7 version to 8.0.7 we would recommend doing this on the staging site first to make sure that everything is ok. Update production site only after that.
Regards
You must be logged in to reply to this topic.Log in/Sign up