XStore Product Tag Page – Sidebar Widget Toggle Available like Product Shop Pag?

This topic has 11 replies, 2 voices, and was last updated 3 years, 1 months ago ago by Olga Barlow

  • Avatar: Six Fourteen
    Six Fourteen
    Participant
    June 3, 2020 at 02:19

    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.

    Please, contact administrator
    for this information.
    10 Answers
    Avatar: Six Fourteen
    Six Fourteen
    Participant
    June 3, 2020 at 04:55

    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;
    }
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    June 3, 2020 at 13:49

    Hello,

    You can use it. We’ll add the toggle for the mentioned taxonomy in the next theme update.

    Regards

    Avatar: Six Fourteen
    Six Fourteen
    Participant
    June 4, 2020 at 01:01

    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.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    June 4, 2020 at 14:19

    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

    Avatar: Six Fourteen
    Six Fourteen
    Participant
    June 4, 2020 at 23:55

    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.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    June 5, 2020 at 15:09

    Hello,

    Ok, sure. Thank you for your understanding, a pleasure to work with!

    Regards

    Avatar: Six Fourteen
    Six Fourteen
    Participant
    July 15, 2020 at 02:29

    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?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 15, 2020 at 17:31

    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

    Avatar: Six Fourteen
    Six Fourteen
    Participant
    September 24, 2021 at 22:08

    Just checking to see when Ajax filtering will be rolled out to taxonomies – per my suggestion in this thread?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 27, 2021 at 11:32

    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

  • Viewing 11 results - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.