How to DISABLE product-categories opened by default

This topic has 15 replies, 5 voices, and was last updated 9 years, 1 months ago ago by Stan Russell

  • Avatar: do0rway
    do0rway
    Participant
    October 26, 2015 at 16:12

    I don’t want the product-categories in the sidebar being opened by default. How can I prevent that?

    i saw an answer on other 8theme theme, but i cannot find the file
    script.js in woopress.

    the solution was:
    1. Open file /js/script.js

    2. Remove (or better outcomment) this part: if(jQuery(’.categories-group.opened’).length > 0) { //jQuery(’.categories-group.has-subnav’).addClass(‘opened’); }else{ // If doesnt exitst opened point jQuery(’.categories-group.has-subnav:first’).addClass(‘opened’).find(‘ul’).show(); }

    thanks

    14 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    October 26, 2015 at 16:38

    Hello,

    To close first category, edit wp-content/themes/woopress/js/etheme.js file. Find and comment out line 1718
    $this.find('>li').first().find('.open-this').html(minusIcon).parent().addClass('opened').find('ul.children').show();

    Regards,
    Robert Hall.

    Avatar: do0rway
    do0rway
    Participant
    October 27, 2015 at 10:23

    so its mean after every update i will need to do it again, right?
    thanks!

    p.s. i never edited that file, but that line its on LINE 1808.
    and by the way, its just between the ELSE code, so i should comment out like that:

    else {
                   //  $(this).html(minusIcon).parent().addClass('opened').find('> ul, > div.nav-sublist-dropdown').slideDown(200);  //
                }
    
    Avatar: Robert Hall
    Robert Hall
    Support staff
    October 27, 2015 at 10:31

    Hello,

    Yes, but if you’ll use the Child Theme you can save it.
    https://www.8theme.com/demo/docs/woopress/index.html#!/3_child_theme

    Please copy this file with changes into it saving folder structure like:
    wp-content/themes/woopress_child/js/etheme.js.

    Regards,
    Robert Hall.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    October 27, 2015 at 10:32

    Hello,

    You can create child theme https://codex.wordpress.org/Child_Themes and make changes there.
    You need add the code in your child theme functions.php file:

    add_action( 'wp_enqueue_scripts', 'etheme' );
    function etheme() {
        wp_enqueue_script( 'etheme', get_stylesheet_directory_uri() . '/js/etheme.js' );
    }

    Then create “js” folder in child theme and copy etheme.js file with needed changes in the child theme “js” directory so you won’t lose modifications after theme update.

    Best regards,
    Jack Richardson.

    Avatar: do0rway
    do0rway
    Participant
    October 27, 2015 at 10:55

    thanks,
    please can you read again my last REPLY over here, as i edit it…
    thanks

    Avatar: Robert Hall
    Robert Hall
    Support staff
    October 27, 2015 at 11:10

    Please see screenshot to understand how to do it – http://prntscr.com/8vu4jw

    Also you can provide us with FTP credentials and we’ll help you with that.

    Regards,
    Robert Hall.

    Avatar: do0rway
    do0rway
    Participant
    October 27, 2015 at 11:23

    even i already read all the things about child theme, and seems i almost understood everything, it with be great if you can do that for me, than i can see what you did and learn from it.
    big thanks

    Please, contact administrator
    for this information.
    Avatar: Robert Hall
    Robert Hall
    Support staff
    October 27, 2015 at 12:53

    Hello,

    I’ve created the Child Theme for you. You can active it in Dashboard->Appearance->Themes.
    Also please clear all cache.

    Regards,
    Robert Hall.

    Avatar: do0rway
    do0rway
    Participant
    October 27, 2015 at 17:09

    it is possible that woocommerce update FIX the problem?
    as i never activate the child theme, and its already working fine.

    thanks anyway

    Avatar: Eva
    Eva Kemp
    Support staff
    October 27, 2015 at 19:11

    Hello,

    Could you please clarify what problem should be fixed after Woocommerce update?

    Regards,
    Eva Kemp.

    Avatar: do0rway
    do0rway
    Participant
    October 27, 2015 at 21:45

    i mean, i asked to make that all categories will be CLOSED automaticly.
    and you guys help out, but before i even activate my child theme, i saw i had UPDATE for woocommerce, so i did the update.

    and the “problem” with the opened categories were FIXED already.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    October 28, 2015 at 08:57

    Hello,

    So is your issue resolved?

    Best regards,
    Jack Richardson.

    Avatar: do0rway
    do0rway
    Participant
    October 28, 2015 at 09:52

    seems like that, just dont understand if i really need that child theme or not.
    as it all happen in the same time. the woocomerce update and the upload of a child theme by 8theme suport (again, without activate the child theme).

    thanks anyway

    Avatar: stan
    Stan Russell
    Participant
    October 28, 2015 at 10:29

    Hello do0rway,

    you are welcome!

    Regards,
    Stan Russell.

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

The issue related to '‘how to DISABLE product-categories opened by default’' has been successfully resolved, and the topic is now closed for further responses

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.