Register with your Envato account

Support forums

Homepage Support Pandora WooCommerce Remove woocommerce menu bar when empty

[Resolved] Remove woocommerce menu bar when empty

Homepage Support Pandora WooCommerce Remove woocommerce menu bar when empty

This topic contains 9 replies, has 2 voices, and was last updated by  lngapp 2 years, 6 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #5387

    lngapp
    Participant

    Hello guys, thanks in advance for help and excuses for my bad english 🙂

    I just want to know if there is a way to remove the woocommerce menu bar in top of page when there is no items in cart (items in cart, checkout…)

    I want to see that only if customer has something in cart…

    A simple way?

    Luc

    #5392

    Hey,

    The best way to do this is by overriding “theme/templates/header.php” file using child theme. You need to check if $woocommerce->cart->cart_contents_count is equal to zero and add extra class if it’s true which can be later styled using CSS or by using “siteOrigin CSS editor” plugin. Other option is custom code JavaScript which will also check the value and hide cart if its’ needed.

    #5395

    lngapp
    Participant

    Hello
    Thanks for answer, it seems a little complicated for me…

    Give me a little time to search for examples and understand how to use child themes 🙂 : )

    Thanks again
    Luc

    #5407

    lngapp
    Participant

    Hello

    I’m trying to use a child theme, but don’t find any zip file with “child” i,n the name in pandora directory…

    Any help please?

    Thanks in advance
    Luc

    #5408

    lngapp
    Participant

    Don’t care of my question, i found the solution by zipping the pandora_child directory 🙂 🙂

    Thanks for help

    #5409

    lngapp
    Participant

    Hi again 🙂

    It’s ok for child theme, i activated him with just style.css in, modified my header.php just trying to comment line:
    // $body_class .= ' pandora-checkout'; and send it on server in pandora-child directory but cart line still appears in header…

    Any help please?

    #5419

    Hey,

    First of all it looks like you have edited wrong header.php, you should edit one which is under templates directory. Second, you need to create correct file structure, so the new file is located in “wp-content/themes/pandora-child/theme/templates/” directory.

    #5437

    lngapp
    Participant

    Thanks for quick answer…
    I’ll try and keep you in touch

    Luc

    #5438

    lngapp
    Participant

    Perfectly tunning, really thanks for quick support 🙂 : )

    Luc

    #5439

    lngapp
    Participant

    Running, not tunning 🙂

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Remove woocommerce menu bar when empty’ is closed to new replies.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close