[Resolved] Mini cart on all pages

  • Author
    Posts
  • #8820

    Kristin Ozanian
    Participant

    Hi, Andrew, I hope you’ve been well 🙂
    I have a quick question as I cannot figure it out myself (not even with the help of the all-knowing Internet). I have the mini cart option on in the theme’s settings, all works perfectly except the mini cart does not display in the menu on the Cart and Checkout pages. I know it’s basic but I’d appreciate your help.
    Thanks,
    Kris

    #8821

    Andrew Misplon
    Keymaster

    Hey Kris 🙂

    Good to hear from you.

    That’s by design. It’s a common pattern. On the cart page the mini-cart would be a duplication of the content already listed on the page. In checkout the idea is to focus users attention on the checkout process. You can also use the Stripped page layout on the cart and checkout pages to remove the menu, sidebar and footer widgets, that’s what it was created for.

    If you want to reverse this pattern let me know and I’ll explain how to do to it in a child theme or custom function.

    #8830

    Kristin Ozanian
    Participant

    Hi, Andrew,
    I know what you mean and I understand the common approach. Nonetheless my client insists on having the navigation bar displayed the same on all pages.
    I’ll be hiding the cart drop down to avoid duplicating content. I intend on doing with #cart-drop {display:none;} as I cannot find the polestar_mini_cart() code anywhere to try and modify it in my child theme. There should be a better way so I rely on your suggestion.
    Thanks!

    #8831

    Andrew Misplon
    Keymaster

    In the parent theme in inc/template-tags.php you’ll find the mini cart function polestar_mini_cart. Copy the entire function and insert it into a child theme functions.php file or use the Code Snippets plugin. Remove this part of the opening conditional:

    && ! ( is_cart() || is_checkout() )

    So that line would then just be:

    if ( class_exists( 'Woocommerce' ) ) : ?>

    #8838

    Kristin Ozanian
    Participant

    Thank you for your FTL replies as always. Sorry for wasting your time… it is pretty obvious and I should have found it. After all you have delivered perfectly organized and documented code. In any case, I hope this thread could be of help to someone else.
    Cheers,
    Kris

    #8839

    Andrew Misplon
    Keymaster

    No worries at all. That function should probably be in the WooCommerce template tags file. I’m sure this will be helpful to other users.

    All the best 🙂 Chat soon. Cheers.

    #14844

    Vlad777
    Participant

    Thanks, very helpful.

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

You must be logged in to reply to this topic.

Scroll to top