• Resolved leap4joy

    (@leap4joy)


    After a woocommerce update, a cart started appearing on the right side of my nav, even when empty. I was given the fix below earlier. The CSS fixed the cart display (made it so it wasn’t visible), but it leaves a large amount of white space to the right of my menu, which is now unusable for the nav tabs. Is there another way to fix this that totally removes the cart from the nav area and free up that nav space?

    .main-navigation .primer-wc-cart-menu
    {
    margin-left: -150%;
    }
    .entry-title {
    margin: 0 0 .275em;
    }

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • gdandrija

    (@gdandrija)

    Hey @leap4joy,

    You will be better off using this code instead:

    
    #menu-main-menu > li.primer-wc-cart-menu.primer-wc-cart-menu-item.menu-item.menu-item-type-nav_menu_item.menu-item-object-cart {
        display: none !important;
    }
    

    Let me know if this helps, have a nice day,
    Andrija

    Thread Starter leap4joy

    (@leap4joy)

    That new snippet of code did not work. When I delayed the earlier snippet and added what you suggested the $0 cart re-appeared in the Nav bar.

    Thread Starter leap4joy

    (@leap4joy)

    Here’s a screen shot of the $0 cart appearing in the nav with what you suggested: https://nataliemarquis.com/files/cart-in-nav.png

    gdandrija

    (@gdandrija)

    Hey @leap4joy,

    I’m sorry to hear this did not work out. By rechecking your website I could see that the code provided was not loaded by your theme at all. If it was overridden, it would be visible in the inspect tab of your browser.

    Screenshot: https://prntscr.com/vdhzte

    Once I readded the same code using inspector I could see it load up properly

    Screenshot: https://prntscr.com/vdi1my

    This could mean that there is a syntax error in your Customizer that is preventing the display, or that code was not copied properly.

    Can you please try an alternative method using the instructions below:
    https://www.wpbeginner.com/plugins/how-to-easily-add-custom-css-to-your-wordpress-site/

    Thanks again,
    Andrija

    Thread Starter leap4joy

    (@leap4joy)

    Hi Andrija,

    You didn’t see the code you suggested in the source code because I removed it when it didn’t work. Anyway, I just put the code back and this time it worked. Weird, but I’m happy it solved the problem. Thank you for your persistence! The issue is resolved.

    Natalie

    Thread Starter leap4joy

    (@leap4joy)

    Resolved thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how to remove cart from nav bar’ is closed to new replies.