- This topic has 10 replies, 2 voices, and was last updated 1 year ago by
David.
-
AuthorPosts
-
February 20, 2020 at 3:34 am #1171257
Carsten
Hi there, I’m looking for a way of hiding the cart from the header menu, when it’s empty. Apparently there are no options for that in WooCommerce or in GP WooCommerce layout settings. This would be a nice feature to integrate in GP WooCommerce layout settings in a future Premium update.
Sorry if this topic already has been discussed, but I was not able to find any about this.
Regards
February 20, 2020 at 3:55 am #1171280David
StaffCustomer SupportHi there,
add this CSS to your Site:
.mobile-bar-items.wc-mobile-cart-items:not(.has-items), .main-navigation li.wc-menu-item:not(.has-items) { display: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 20, 2020 at 4:05 am #1171284Carsten
Thanks for quick response, it works like a charm!
February 20, 2020 at 6:24 am #1171399David
StaffCustomer SupportGlad to be of help 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 28, 2020 at 9:31 pm #1180219Dana
Hi David,
I tried the CSS above and it works for desktop but the cart is still visible when viewing mobile.
Any suggestions?
February 29, 2020 at 6:00 am #1180426David
StaffCustomer SupportHi there,
can you raise a new topic where you can share a link to your site so i can take a look?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 1, 2020 at 4:44 pm #1181760Dana
My site is currently on localhost only.
I’ll play around and see if I can figure it out before moving the site to my host. Not a show stopper at this point.
March 2, 2020 at 3:17 am #1182030David
StaffCustomer SupportOK – let us know.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 22, 2020 at 11:48 am #1206464Dana
Hi David,
I was about to open a new topic as I just moved my site to staging but I figured out a way to force the cart to hide when empty when viewing in responsive mode. I added the
!important
rule. I’m not sure if that is best approach but it works. Thought I would post it here in case anyone else runs across the same issue..mobile-bar-items.wc-mobile-cart-items:not(.has-items), .main-navigation li.wc-menu-item:not(.has-items) { display: none !important; }
January 12, 2022 at 4:11 pm #2078566hastibe
Hmm, I added this CSS to the Additional CSS panel of my site, but it had no effect (after refreshing and with caching disabled, etc., even though the cart is empty). Is this CSS code still working?
UPDATE: found updated CSS, here–all is working now!
January 13, 2022 at 4:15 am #2078920David
StaffCustomer SupportGlad to hear you found a solution
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.